[
  {
    "path": ".gitignore",
    "content": "var/database.sqlite3\nvar/database.sqlite3.v0\nvar/results\nnode_modules\nnpm-debug.log\nproduction.js\n*.swp\n"
  },
  {
    "path": ".gitmodules",
    "content": ""
  },
  {
    "path": "README.md",
    "content": "# shib\n\n* http://github.com/tagomoris/shib\n* Blog entry [tagomoris.tumblr](http://tagomoris.tumblr.com/post/77890621867/shib-web-client-for-hive-now-supports-presto)\n\n## DESCRIPTION\n\nShib is web client application for SQL-like query engines, written in Node.js, supporting\n * Hive (hiveserver, hiveserver2)\n * Facebook Presto\n * Google BigQuery\n\nOnce configured, we can switch query engines per executions.\n\nSome extension features are supported:\n\n* Setup queries: options to specify queries executed before main query, like 'create functions ...'\n* Default Database: option to specify default database for Hive 0.6 or later\n\n### Versions\n\nLatest version of 'shib' is v1.0.2.\n\n'shib' versions are:\n\n* v1.0 series\n  * metadata of v1.0 is **NOT compatible with v0.3**, so migration required\n* v0.3 series\n  * use latest node (`~> v0.10.26`)\n  * multi engines/databases support\n  * presto support\n  * storages of v0.3.x are compatible with v0.2\n  * engine-wide database/table access controls\n  * tagging for executed queries\n  * authentication / logging for query execution\n  * access controls based on authentication\n* v0.2 series\n  * current status of master branch\n  * uses local filesystem instead of KT, depends on latest node (v0.8.x, v0.10.x)\n  * higher performance, more safe Web UI and updated features\n  * storages of v0.2 are **NOT complatible with v0.1**\n* v0.1 series\n  * uses KT, depends on node v0.6.x\n  * see `v0.1` tag\n\n## INSTALL\n\n### Hive/Presto\n\nFor Hive queries, shib requires HiveServer or HiveServer2. Setup and run these.\n\n* For HiveServer2\n  * Configure `hive.server2.authentication` as `NOSASL`\n    * Strongly recommended to configure `hive.support.concurrency` as `false`\n\nFor Presto, shib is tested with Presto version 0.57.\n\n### Node.js\n\nTo run shib, you must install node.js (v0.10.x recommended), and export PATH for installed node.\n\n### shib\n\nClone shib code.\n\n    $ git clone git://github.com/tagomoris/shib.git\n\nInstall libraries, configure addresses of HiveServer (and other specifications).\n\n    $ npm install\n    $ vi config.js\n\nAnd run.\n\n    $ npm start\n\nShib listens on port 3000. see http://localhost:3000/\n\nTo switch environments for each shib instance, use `NODE_ENV` environment variable. (ex: `production.js` will be used with `NODE_ENV=production`)\n\n    $ NODE_ENV=production NODE_PATH=lib node app.js\n\n## Migrate metadata database from v0 to v1\n\nMigration operation required to execute shib v1, with data in v0 era.\n\n1. Stop shib process\n2. Update shib code to v1\n3. Execute `npm run migrate` (for `var/database.sqlite3` file)\n  * This operation requires 5 minutes 30 seconds for 220MB database\n  * Backup v0 database file is `var/database.sqlite3.v0`\n4. Start shib\n\n## Configuration\n\nShib can have 2 or more query executor engines.\n\n### HiveServer2\n\nBasic configuration with HiveServer2 in config.js (or productions.js):\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,   // lines per fetch in shib\n  query_timeout: null, // shib waits queries forever\n  setup_queries: [],\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'mycluster1',\n      executer: {\n        name: 'hiveserver2',\n        host: 'hs2.mycluster1.local',\n        port: 10000,\n        username: 'hive',\n        support_database: true\n      },\n      monitor: null\n    },\n  ],\n};\n```\n\n`username` should be same as user name that hive job will be executed on. (`password` is not required for NOSASL transport.)\n\nFor UDFs, you can specify statements before query executions in `setup_queries`.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null,\n  setup_queries: [\n    \"add jar /path/to/jarfile/foo.jar\",\n    \"create temporary function foofunc as 'package.of.udf.FooFunc'\",\n    \"create temporary function barfunc as 'package.of.udf.BarFunc'\"\n  ],\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'mycluster1',\n      executer: {\n        name: 'hiveserver2',\n        host: 'hs2.mycluster1.local',\n        port: 10000,\n        support_database: true\n      },\n      monitor: null\n    },\n  ],\n};\n```\n\n### HiveServer\n\nClassic HiveServer is available if you want database supports instead of HiveServer2.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null,\n  setup_queries: [],\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'mycluster1',\n      executer: {\n        name: 'hiveserver',  // HiveServer(1)\n        host: 'hs1.mycluster1.local',\n        port: 10000,\n        support_database: true,\n        default_database: 'mylogs1'\n      },\n      monitor: null\n    },\n  ],\n};\n```\n\n### Presto\n\nFor Presto, use `presto` executer.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: 30, // 30 seconds for Presto query timeouts (it will fail)\n  setup_queries: [],\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'prestocluster1',\n      executer: {\n        name: 'presto',\n        host: 'coordinator.mycluster2.local',\n        port: 8080,\n        user: 'shib',\n        catalog: 'hive',  // required configuration argument\n        support_database: true,\n        default_database: 'mylogs1'\n      },\n      monitor: null\n    },\n  ],\n};\n```\n\n### BigQuery\n\nFor BigQuery, use `bigquery` executer.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: 30, // 30 seconds for BigQuery query timeouts (it will fail)\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'bigquery',\n      executer: {\n        name: 'bigquery',\n        default_database: 'mylogs1',\n        project_id: 'gcp-project-id',\n        key_filename: '/path/to/keyfile.json'\n      },\n      monitor: null\n    }\n  ]\n};\n```\n \nFor more detail about `project_id` and `key_filename` config, see https://github.com/GoogleCloudPlatform/gcloud-node#authorization .\n\n### Multi clusters and engines\n\nShib supports 2 or more engines for a cluster, and 2 or more clusters with same engines. These patterns are available.\n\n* HiveServer1, HiveServer2 and Presto for same data source\n* 2 or more catalogs for same Presto cluster\n* Many clusters which has one of HiveServer, HiveServer2 or Presto\n\nYou should write configurations in `engines` how you wants. `fetch_lines`, `query_timeout` and `setup_queries` in each engines overwrites global default of these configurations.\n\nFor example, This is configuration example.\n * ClusterA has HiveServer2\n   * listenes port 10000\n   * customized udfs in `foo.jar` are availabe\n * ClusterB has HiveServer\n   * listenes port 10001\n   * customized udfs in `foo.jar` are available\n * Presto cluster is configured with `hive` catalog and `hive2` catalog\n   * udfs are not available\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null,\n  setup_queries: [\n    \"add jar /path/to/jarfile/foo.jar\",\n    \"create temporary function foofunc as 'package.of.udf.FooFunc'\",\n    \"create temporary function barfunc as 'package.of.udf.BarFunc'\"\n  ],\n  storage: {\n    datadir: './var'\n  },\n  engines: [\n    { label: 'myclusterA',\n      executer: {\n        name: 'hiveserver2',\n        host: 'master.a.cluster.local',\n        port: 10000,\n        support_database: true\n      },\n      monitor: null\n    },\n    { label: 'myclusterB',\n      executer: {\n        name: 'hiveserver',\n        host: 'master.b.cluster.local',\n        port: 10001,\n        support_database: true,\n        default_database: 'mylogs1'\n      },\n      monitor: null\n    },\n    { label: 'prestocluster1',\n      executer: {\n        name: 'presto',\n        host: 'coordinator.p.cluster.local',\n        port: 8080,\n        user: 'shib',\n        catalog: 'hive',\n        support_database: true,\n        default_database: 'mylogs1',\n        query_timeout: 30,  // overwrite global config\n        setup_queries: []   // overwrite global config\n      },\n      monitor: null\n    },\n    { label: 'prestocluster2',\n      executer: {\n        name: 'presto',\n        host: 'coordinator.p.cluster.local',\n        port: 8080,\n        user: 'shib',\n        catalog: 'hive2',  // one engine config per catalogs\n        support_database: true,\n        default_database: 'default',\n        query_timeout: 30,  // overwrite global config\n        setup_queries: []   // overwrite global config\n      },\n      monitor: null\n    }\n  ],\n};\n```\n\n### Access Control\n\nShib have access control list for Databases/Tables. Default is 'allow' for all databases/tables.\n\nShib's access control rules are:\n  * configure per executer\n  * database level default ('allow' or 'deny') without any optional rules makes that database unvisible\n  * database level default + allow/deny table list makes its tables visible/unvisible\n    * in this case, this 'database' is visible\n  * default 'allow' or 'deny' decides visibilities of databases without any optional rules\n\n'unvisible' databases and tables:\n * are not shown in tables/partitions list and schema list\n * cannot be queried by users (these queries always fails)\n\nAccess control options are written in 'executer' like this:\n\n```js\nexecuter: {\n  name: 'presto',\n  host: 'coordinator.p.cluster.local',\n  port: 8080,\n  catalog: 'hive',\n  support_database: true,\n  default_database: 'default',\n  query_timeout: 30,\n  setup_queries: [],\n  access_control: {\n    databases: {\n      secret: { default: \"deny\" },\n      member: { default: \"deny\", allow: [\"users\"] },\n      test:   { default: \"allow\", deny: [\"secretData\", \"userMaster\"] },\n    },\n    default: \"allow\"\n  }\n},\n```\n\nFor more details, see [wiki: Access Control](https://github.com/tagomoris/shib/wiki/Access-Control).\n\n## Monitors\n\n`monitor` configurations are used to get query status and to kill queries.\n\n### JobTracker (MRv1)\n\n`jobtracker` monitor is available in MRv1 environment (w/ both of hiveserver and hiveserver2).\n\n```js\nmonitor: {\n  name: 'jobtracker',\n  host: 'jobtracker.hostname.local',\n  port: 50030,\n  mapred: '/usr/bin/mapred' // 'mapred' in PATH by default\n}\n```\n\nFor this feature, shib should be executed by a user who can execute command `mapred job -kill JOB_ID`.\n\n### YARN (MRv2)\n\n`yarn` monitor is available in MRv2 environment (w/ both of hiveserver and hiveserver2).\n\n```js\nmonitor: {\n  name: 'yarn',\n  host: 'resourcemanager.hostname.local',\n  port: 8088\n}\n```\nIn this case, shib kills query with Resource Manager REST API.\n\nIf you specify yarn command description, shib kills query with `yarn application -kill APP_ID`.\n```js\nmonitor: {\n  name: 'yarn',\n  host: 'resourcemanager.hostname.local',\n  port: 8088,\n  yarn: '/usr/bin/yarn'\n}\n```\n\n### Huahin Manager (obsolete)\n\nFor monitors in CDH4 + MRv1 environment, Huahin manager is available.\n\nTo show map/reduce status, and/or to kill actual map/reduce jobs behind hive query, shib can use Huahin Manager. Current version supports only 'Huahin Manager CDH4 + MRv1' only.\n\nhttp://huahinframework.org/huahin-manager/\n\nConfigure `monitor` argument like below instead of `null`.\n\n```js\nmonitor: {\n  name : 'huahin_mrv1',\n  host: 'localhost',\n  port: 9010\n}\n```\n\n## Authentication\n\nShib have authentication to log who execute queries and to control accesses:\nsetup_queries_auth option means to specify queries executed before main query when authentication is required.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,   // lines per fetch in shib\n  query_timeout: null, // shib waits queries forever\n  setup_queries: [],\n  setup_queries_auth: [\"set hive.mapred.mode=strict\"],\n  storage: {\n    datadir: './var'\n  },\n  auth: {\n    type: 'http_basic_auth',\n    url: 'http://your.internal.protected.service.example.com/',\n    realm: '@your.service.example.com'\n  },\n  engines: [\n    { label: 'mycluster1',\n      executer: {\n        name: 'hiveserver2',\n        host: 'hs2.mycluster1.local',\n        port: 10000,\n        username: 'hive',\n        support_database: true\n      },\n      monitor: null\n    },\n  ],\n};\n```\n\nFor more details, see [wiki: Authentication](https://github.com/tagomoris/shib/wiki/Authentication).\n\n## Miscellaneous configurations\n\n### Disable \"history\" tab\n\nSpecify `disable_history: true` on `servers`.\n\n```js\nvar servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null, // seconds. (null:shib will wait query response infinitely).\n  setup_queries: [],\n  disable_history: true,\n  storage: {\n    datadir: './var'\n  },\n```\n\n## As HTTP Proxy for query engines\n\nPOST query string into `/execute` with some parameters.\n\n```\ncurl -s -X POST -F 'querystring=SELECT COUNT(*) AS cnt FROM yourtable WHERE field=\"value\"' http://shib.server.local:3000/execute | jq .\n{\n  \"queryid\": \"69927e67c5b1d5f665697943cc4867ec\",\n  \"results\": [],\n  \"dbname\": \"default\",\n  \"engine\": \"hiveserver\",\n  \"querystring\": \"SELECT COUNT(*) AS cnt FROM yourtable WHERE field=\\\"value\\\"\"\n}\n```\n\nSpecify `engineLabel` and `dbname` for non-default query engines and databases:\n\n```\ncurl -s -X POST -F \"engineLabel=presto\" -F \"dbname=testing\" -F \"querystring=SELECT COUNT(*) AS cnt FROM yourtable WHERE field='value'\" http://shib.server.local:3000/execute\n```\n\nIf you want not to add your query into history tab, specify 'scheduled':\n\n```\ncurl -s -X POST -F \"scheduled=true\" -F \"querystring=SELECT COUNT(*) AS cnt FROM yourtable WHERE field='value'\" http://shib.server.local:3000/execute\n```\n\nThen, fetch query's status whenever you want.\n\n```\ncurl -s http://shib.server.local:3000/status/69927e67c5b1d5f665697943cc4867ec \nexecuted\n```\n\nOr get whole query object.\n\n```\ncurl -s http://shib.server.local:3000/query/69927e67c5b1d5f665697943cc4867ec | jq .\n{\n  \"queryid\": \"69927e67c5b1d5f665697943cc4867ec\",\n  \"results\": [\n    {\n      \"resultid\": \"969629614dff69411a2f4f1733c9616a\",\n      \"executed_at\": \"Wed Feb 26 2014 16:02:00 GMT+0900 (JST)\"\n    }\n  ],\n  \"dbname\": \"default\",\n  \"engine\": \"hiveserver\",\n  \"querystring\": \"SELECT COUNT(*) AS cnt FROM yourtable WHERE field=\\\"value\\\"\"\n}\n```\n\nIf this query object has `executed` status, or a member of `results`, you can fetch its result by `resultid`.\n\n```\n# if you want elasped time or bytes or lines or ....\ncurl -s http://shib.server.local:3000/result/969629614dff69411a2f4f1733c9616a | jq .\n{\n  \"schema\": [\n    {\n      \"type\": \"bigint\",\n      \"name\": \"cnt\"\n    }\n  ],\n  \"completed_msec\": 1393398893759,\n  \"completed_at\": \"Wed Feb 26 2014 16:14:53 GMT+0900 (JST)\",\n  \"completed_time\": null,\n  \"bytes\": 6,\n  \"queryid\": \"69927e67c5b1d5f665697943cc4867ec\",\n  \"executed_time\": null,\n  \"executed_at\": \"Wed Feb 26 2014 16:14:52 GMT+0900 (JST)\",\n  \"executed_msec\": 1393398892752,\n  \"resultid\": \"969629614dff69411a2f4f1733c9616a\",\n  \"state\": \"done\",\n  \"error\": \"\",\n  \"lines\": 2\n}\n# raw result data as TSV (fast)\ncurl -s http://shib.server.local:3000/download/tsv/969629614dff69411a2f4f1733c9616a | jq .\nCNT\n1234567\n# or CSV (slow)\ncurl -s http://shib.server.local:3000/download/csv/969629614dff69411a2f4f1733c9616a | jq .\n\"CNT\"\n\"1234567\"\n```\n\nThese HTTP requests/response are same with that javascript on browser does.\n\n* * * * *\n\n## TODO\n\n* Paches are welcome!\n\n## License\n\nCopyright 2011- TAGOMORI Satoshi (tagomoris)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "app.js",
    "content": "var express = require('express'),\n    jade = require('jade'),\n    async = require('async'),\n    fs = require('fs'),\n    app = express();\n\nvar RECENT_FETCHES = 50;\nvar SHOW_RESULT_HEAD_LINES = 20;\n\nvar InvalidQueryError = require('shib/query').InvalidQueryError;\nvar SimpleCSVBuilder = require('shib/simple_csv_builder').SimpleCSVBuilder;\n\nvar shib = require('shib');\nvar config_package = {};\n\nif (process.env.NODE_ENV) {\n  config_package = require('./' + process.env.NODE_ENV);\n} else {\n  config_package = require('./config');\n}\nvar servers = config_package.servers;\nshib.init(servers);\n\nfunction shutdown(signal){\n  shib.logger().info('Shutdown by signal', {signal: signal});\n  process.exit();\n};\nprocess.on('SIGINT', function(){ shutdown('SIGINT'); });\nprocess.on('SIGHUP', function(){ shutdown('SIGHUP'); });\nprocess.on('SIGQUIT', function(){ shutdown('SIGQUIT'); });\nprocess.on('SIGTERM', function(){ shutdown('SIGTERM'); });\n\nvar runningQueries = {};\n\nfunction error_handle(req, res, err){\n  shib.logger().error('Error in app', err);\n  if (err.stack)\n    shib.logger().error(err.stack);\n  res.send(err, 500);\n};\n\nfunction shibclient(req){\n  return shib.client({credential: shib.auth().credential(req)});\n}\n\napp.configure(function(){\n  app.use(express.static(__dirname + '/public'));\n  app.use(express.methodOverride());\n  app.use(express.urlencoded());\n  app.use(express.json());\n  app.use(express.bodyParser());\n\n  app.use(app.router);\n\n  app.set('view options', {layout: false});\n  app.set('port', (servers.listen || process.env.PORT || 3000));\n});\n\napp.use(function(err, req, res, next){\n  if (!err) {\n    next();\n  }\n  else {\n    shib.logger().error('ServerError', err);\n    err.stack.split(\"\\n\").forEach(function(line){\n      shib.logger().error(line);\n    });\n    res.send(500, 'Server Error');\n  }\n});\n\napp.configure('development', function(){\n  app.use(express.static(__dirname + '/public'));\n  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));\n});\n\napp.configure('production', function(){\n  app.use(express.logger('default'));\n  var onehour = 3600;\n  app.use(express.static(__dirname + '/public', { maxAge: onehour }));\n  app.use(express.errorHandler());\n});\n\napp.get('/', function(req, res){\n  var client = shibclient(req);\n  res.render(__dirname + '/views/index.jade');\n  client.end();\n});\n\napp.post('/auth', function(req, res){\n  var auth = shib.auth();\n\n  auth.check(req, function(err, result){\n    if (err) { error_handle(req, res, err); return; }\n    if (result) {\n      // if auth module is dumb, username becomes String('undefined') and password becomes String('undefined')\n      var authInfo = auth.crypto(result.username);\n      res.send(200, {authInfo: authInfo, realm: auth.realm, enabled: auth.enabled});\n    } else {\n      res.send(403, {authInfo: null, realm: auth.realm, enabled: auth.enabled});\n    }\n  });\n});\n\napp.get('/q/:queryid', function(req, res){\n  // Only this request handler is for permalink request from browser URL bar.\n  var client = shibclient(req);\n  res.render(__dirname + '/views/index.jade');\n  client.end();\n});\n\napp.get('/t/:tag', function(req, res){\n  // Only this request handler is for permalink request from browser URL bar.\n  var client = shibclient(req);\n  res.render(__dirname + '/views/index.jade');\n  client.end();\n});\n\napp.get('/runnings', function(req, res){\n  var runnings = [];\n  for (var queryid in runningQueries) {\n    var times = (function(){\n      var secs = Math.floor(((new Date()) - runningQueries[queryid]) / 1000);\n      if (secs < 60)\n        return secs + ' seconds';\n      var mins = Math.floor(secs / 60);\n      if (mins < 60)\n        return mins + ' minutes';\n      var hours = Math.floor(mins / 60);\n      return hours + ' hours';\n    })();\n    runnings.push([queryid, times]);\n  }\n  res.send(runnings);\n});\n\n\nvar enginesCache = null;\n\napp.get('/engines', function(req, res){\n  /*\n  // \"monitor\" means support 'status' (and 'kill') or not.\n  {\n    pairs: [ [engine_label, dbname], [engine_label, dbname], ... ],\n    monitor: { label: bool }\n  }\n   */\n\n  // If authentications are always required, database list cannot be cached.\n  if (shib.auth().require_always) {\n    shibclient(req).engineInfo(function(err, info){\n      if (err) { error_handle(req, res, err); this.end(); return; }\n      res.send(info);\n      this.end();\n    });\n    return;\n  }\n\n  var info = enginesCache;\n  if (info) {\n    res.send(info);\n  }\n  else {\n    shibclient(req).engineInfo(function(err, info){\n      if (err) { error_handle(req, res, err); this.end(); return; }\n      enginesCache = info;\n      res.send(info);\n      this.end();\n    });\n  }\n});\n\napp.get('/tables', function(req, res){\n  var client = shibclient(req);\n  var engineLabel = req.query.engine;\n  var database = req.query.db;\n  client.tables(engineLabel, database, function(err, result){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send(result);\n    client.end();\n  });\n});\n\napp.get('/partitions', function(req, res){\n  var engineLabel = req.query.engine;\n  var database = req.query.db;\n  var tablename = req.query.key;\n  if (/^[a-z0-9_]+$/i.exec(tablename) == null) {\n    error_handle(req, res, {message: 'invalid tablename for show partitions: ' + tablename});\n    return;\n  }\n  var client = shibclient(req);\n  client.partitions(engineLabel, database, tablename, function(err, results){\n    if (err) { error_handle(req, res, err); client.end(); return; }\n    res.send(results);\n    client.end();\n  });\n});\n\nvar describe_node_template = 'tr\\n  td= colname\\n  td= coltype\\n  td= colcomment\\n';\n\napp.get('/describe', function(req, res){\n  var engineLabel = req.query.engine;\n  var database = req.query.db;\n  var tablename = req.query.key;\n  if (/^[a-z0-9_]+$/i.exec(tablename) == null) {\n    error_handle(req, res, {message: 'invalid tablename for show partitions: ' + tablename});\n    return;\n  }\n  var fn = jade.compile(describe_node_template);\n  var client = shibclient(req);\n  client.describe(engineLabel, database, tablename, function(err, result){\n    if (err) { error_handle(req, res, err); client.end(); return; }\n    var response_html = '<tr><th>col_name</th><th>type</th><th>comment</th></tr>';\n    result.forEach(function(cols){\n      response_html += fn.call(this, {colname: cols[0], coltype: cols[1], colcomment: cols[2]});\n    });\n    res.send([{title: '<table>' + response_html + '</table>'}]);\n    client.end();\n  });\n});\n\napp.get('/summary_bulk', function(req, res){\n  var client = shibclient(req);\n\n  if (shib.setting('disable_history')) {\n    res.send({disabled: true});\n    return;\n  }\n\n  var history_queries;\n  var history = [];     /* [\"201302\", \"201301\", \"201212\", \"201211\"] */\n  var history_ids = {}; /* {\"201302\":[query_ids], \"201301\":[query_ids], ...} */\n  var query_ids = [];   /* [query_ids of all months] */\n  var fetchRecent = function(cb){\n    client.recentQueries(RECENT_FETCHES, function(err, list){ // list: [Query, ...]\n      if (err) { cb(err); return; }\n      history_queries = list;\n      cb(null);\n    });\n  };\n  var bundleMonths = function(cb){ // [{yyyymm:...,queryid:....}] => {yyyymm:[queryids], yyyymm:[queryids]}\n    var pad = function(n){return n < 10 ? '0'+n : n;};\n    var historyKey = function(date){\n      return '' + date.getFullYear() + pad(date.getMonth() + 1);\n    };\n    history_queries.forEach(function(query){\n      var month = historyKey(query.datetime);\n      if (history.indexOf(month) < 0)\n        history.push(month);\n      if (! history_ids[month])\n        history_ids[month] = [];\n      history_ids[month].push(query.queryid);\n      query_ids.push(query.queryid);\n    });\n    history.sort().reverse();\n    cb(null);\n  };\n  var queryUnique = function(cb){\n    var exist_ids = {};\n    query_ids = query_ids.filter(function(id){ if (exist_ids[id]) return false; exist_ids[id] = true; return true;});\n    cb(null);\n  };\n\n  async.series([fetchRecent, bundleMonths, queryUnique], function(err, results){\n    if (err) { error_handle(req, res, err); return; }\n    res.send({history: history, history_ids: history_ids, query_ids: query_ids});\n  });\n});\n\n// generate pseudo query object (simulate v0 query)\nfunction pseudo_query_data(query){\n  var q = {};\n  q['queryid'] = query.queryid;\n  q['engine'] = query.engine;\n  q['dbname'] = query.dbname;\n  q['querystring'] = query.querystring;\n  q['results'] = [];\n  if (query.state !== \"running\") {\n    q['results'] = [{resultid: query.resultid, executed_at: new Date(query.datetime).toLocaleString()}];\n  }\n  return q;\n}\n\napp.post('/execute', function(req, res){\n  var auth = shib.auth();\n\n  var client = shibclient(req);\n  var engineLabel = req.body.engineLabel;\n  var dbname = req.body.dbname;\n  if (!engineLabel || !dbname) {\n    engineLabel = enginesCache.pairs[0][0];\n    dbname = enginesCache.pairs[0][1];\n  }\n\n  var querystring = req.body.querystring;\n  var scheduled = req.body.scheduled;\n\n  var userdata = auth.userdata(req);\n\n  if (auth.require_always && !userdata) {\n    shib.logger().warn('This shib requires authentication to execute queries, but there are no authInfo', {query: querystring});\n    res.send(403, \"Authentication failed\");\n    return;\n  }\n  if (userdata) {\n    shib.logger().info('User try to execute query', {username: userdata.username, query: querystring});\n  }\n\n  client.createQuery(engineLabel, dbname, querystring, scheduled, userdata, function(err, query){\n    if (err) {\n      if (err.error) {\n        err = err.error;\n      }\n      if (err instanceof InvalidQueryError) {\n        shib.logger().warn('Invalid query submitted', {query: querystring, err: err.message});\n        res.send(400, err.message);\n        this.end();\n        return;\n      }\n      error_handle(req, res, err); return;\n    }\n    res.send(pseudo_query_data(query));\n    var queryid = query.queryid;\n    this.execute(query, {\n      prepare: function(){ runningQueries[queryid] = new Date(); },\n      stopCheck: function(){ return (! runningQueries[queryid]); },\n      stop:    function(){ client.end(); },\n      success: function(){ delete runningQueries[queryid]; client.end(); },\n      error:   function(){ delete runningQueries[queryid]; client.end(); }\n    });\n  });\n});\n\napp.post('/giveup', function(req, res){\n  var targetid = req.body.queryid;\n  var client = shibclient(req);\n  client.query(targetid, function(err, query){\n    client.giveup(query, function(err, query) {\n      if (err) {error_handle(req, res, err); client.end(); return;}\n      client.end(true); // half close\n      delete runningQueries[query.queryid];\n      res.send(pseudo_query_data(query));\n    });\n  });\n});\n\napp.post('/delete', function(req, res){\n  var targetid = req.body.queryid;\n  var client = shibclient(req);\n  delete runningQueries[targetid];\n  client.deleteQuery(targetid, function(err){\n    if (err) {error_handle(req, res, err); client.end(); return;}\n    res.send({result:'ok'});\n    client.end();\n  });\n});\n\n//TODO: any APIs w/o pseudo_query_data ?\n\napp.get('/query/:queryid', function(req, res){\n  shibclient(req).query(req.params.queryid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    if (query === null) {\n      res.send('query not found', 404);\n      this.end();\n      return;\n    }\n    res.send(pseudo_query_data(query));\n    this.end();\n  });\n});\n\napp.post('/queries', function(req, res){\n  shibclient(req).queries(req.body.ids, function(err, queries){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send({queries: queries.map(function(q){ return pseudo_query_data(q); })});\n    this.end();\n  });\n});\n\napp.get('/tags/:queryid', function(req, res){\n  shibclient(req).tags(req.params.queryid, function(err, tags){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send(tags);\n    this.end();\n  });\n});\n\napp.post('/addtag', function(req, res){\n  var tag = req.body.tag;\n  if (tag.length < 1 || tag.length > 16) {\n    error_handle(req, res, {message: 'invalid tag length [1-16]'});\n    return;\n  }\n  shibclient(req).addTag(req.body.queryid, tag, function(err){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send({result:'ok'});\n    this.end();\n  });\n});\n\napp.post('/deletetag', function(req, res){\n  shibclient(req).deleteTag(req.body.queryid, req.body.tag, function(err){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send({result:'ok'});\n    this.end();\n  });\n});\n\napp.get('/tagged/:tag', function(req, res){\n  shibclient(req).taggedQueries(req.params.tag, function(err, queryids){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send(queryids);\n    this.end();\n  });\n});\n\napp.get('/taglist', function(req, res){\n  shibclient(req).tagList(function(err, tags){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    res.send(tags);\n    this.end();\n  });\n});\n\n// convert query.state into status label (simulate v0 Client.prototype.status)\nfunction pseudo_status(query_state){\n   /*\n    running: newest-and-only query running, and result not stored yet.\n    executed (done): newest query executed, and result stored.\n    error: newest query executed, but done with error.\n   */\n  switch (query_state) {\n    case 'running': return \"running\";\n    case 'error': return \"error\";\n    default: return \"executed\";\n  }\n}\n\napp.get('/status/:queryid', function(req, res){\n  shibclient(req).query(req.params.queryid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    if (query === null) {\n      res.send('query not found', 404);\n      this.end();\n      return;\n    }\n    res.send(pseudo_status(query.state));\n    this.end();\n  });\n});\n\napp.get('/detailstatus/:queryid', function(req, res){\n  shibclient(req).query(req.params.queryid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    this.detailStatus(query, function(err, data){\n      if (err) { error_handle(req, res, err); this.end(); return; }\n      if (data === null)\n        res.send('query not found', 404);\n      else\n        res.send(data);\n      this.end();\n    });\n  });\n});\n\n// generate pseudo result object (simulate v0 result)\nfunction pseudo_result_data(query){\n  var r = query.result;\n  r['resultid'] = query.resultid;\n  r['executed_at'] = new Date(query.datetime).toLocaleString();\n  if (r['completed_at'])\n    r['completed_at'] = new Date(r['completed_at']).toLocaleString();\n  r['state'] = query.state;\n  return r;\n}\n\napp.get('/lastresult/:queryid', function(req, res){\n  shibclient(req).query(req.params.queryid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    if (query === null) {\n      res.send('query not found', 404);\n      this.end();\n      return;\n    }\n    res.send(pseudo_result_data(query));\n    this.end();\n  });\n});\n\napp.get('/result/:resultid', function(req, res){\n  shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n    if (query === null) {\n      res.send('query not found', 404);\n      this.end();\n      return;\n    }\n    res.send(pseudo_result_data(query));\n    this.end();\n  });\n});\n\napp.post('/results', function(req, res){\n  /*\n   * obsolete: bad implementation for API compatibility\n   */\n  var client = shibclient(req);\n  var fetchers = (req.body.ids || []).map(function(resultid){\n    return function(cb){\n      client.getQueryByResultId(resultid, function(err, query){\n        if (query === null) {\n          res.send('query not found', 404);\n          this.end();\n          return;\n        }\n        if (err) { cb(err); return; }\n        cb(null, pseudo_result_data(query));\n      });\n    };\n  });\n  async.series(fetchers, function(err, results){\n    if (err) { error_handle(req, res, err); client.end(); return; }\n    res.send({results: results});\n    client.end();\n  });\n});\n\napp.get('/show/full/:resultid', function(req, res){\n  var client = shibclient(req);\n  var file = client.generatePath(req.params.resultid);\n  if (! fs.existsSync(file)) {\n    res.send(null);\n    res.end();\n    client.end();\n    return;\n  }\n  res.sendfile(file)\n});\n\napp.get('/show/head/:resultid', function(req, res){\n  var client = shibclient(req);\n  var file = client.generatePath(req.params.resultid);\n  if (! fs.existsSync(file)) {\n    res.send(null);\n    res.end();\n    client.end();\n    return;\n  }\n  var rStream = fs.createReadStream(file);\n  var readline = require('readline');\n  var rl = readline.createInterface(rStream, {});\n  var line_number = 0;\n  rl.on('line', function(line) {\n    if (line_number < SHOW_RESULT_HEAD_LINES) {\n      res.write(line + '\\n');\n      line_number++;\n    } else {\n      rl.close();\n    }\n  });\n  rl.on('close', function() {\n    res.end();\n    client.end();\n  });\n  res.on('resume', function() {\n    rl.resume();\n  });\n});\n\napp.get('/download/tsv/:resultid', function(req, res){\n  shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n\n    if (query === null) {\n      res.send(null);\n      this.end();\n      return;\n    }\n\n    res.attachment(req.params.resultid + '.tsv');\n    res.set('X-Shib-Query-ID', query.queryid);\n    res.set('X-Shib-Result-ID', query.resultid);\n    res.set('X-Shib-Executed-At', new Date(query.datetime).getTime());\n    res.set('X-Shib-Completed-At', query.result.completed_msec || 0);\n\n    var client = shib.client();\n    var file = client.generatePath(req.params.resultid);\n    if (! fs.existsSync(file)) {\n      res.send(null);\n      res.end();\n      client.end();\n      return;\n    }\n    res.sendfile(file)\n  });\n});\n\napp.get('/download/csv/:resultid', function(req, res){\n  shibclient(req).getQueryByResultId(req.params.resultid, function(err, query){\n    if (err) { error_handle(req, res, err); this.end(); return; }\n\n    if (query === null) {\n      res.send(null);\n      this.end();\n      return;\n    }\n\n    res.attachment(req.params.resultid + '.csv');\n    res.set('X-Shib-Query-ID', query.queryid);\n    res.set('X-Shib-Result-ID', query.resultid);\n    res.set('X-Shib-Executed-At', new Date(query.datetime).getTime());\n    res.set('X-Shib-Completed-At', query.result.completed_msec || 0);\n\n    var client = shib.client();\n    var file = client.generatePath(req.params.resultid);\n    if (! fs.existsSync(file)) {\n      res.send(null);\n      res.end();\n      client.end();\n      return;\n    }\n    var rStream = fs.createReadStream(file);\n    var readline = require('readline');\n    var rl = readline.createInterface(rStream, {});\n    rl.on('line', function(line){\n      res.write(SimpleCSVBuilder.build(line.split('\\t')));\n    });\n    rl.on('close', function(){\n      res.end();\n      client.end();\n    });\n    res.on('resume', function(){\n      rl.resume();\n    });\n  });\n});\n\nshib.auth(); // to initialize and check auth module\nshib.client().end(); // to initialize sqlite3 database\n\nshib.logger().info('Starting shib.');\n\nif (! shib.auth().require_always){\n  var d = require('domain').create();\n  d.on('error', function(err){\n    // Failed to update engine cache\n    // This may occur by communication errors w/ servers\n    if (err.code === 'ECONNREFUSED') {\n      var e = err.domainEmitter;\n      shib.logger().error('Connection refused', {host: e.host, port: e.port});\n    } else {\n      shib.logger().error('In domain creation', err);\n    }\n    process.exit();\n  });\n  d.run(function(){\n    var enginesCacheUpdate = function(){\n      var AccessControl = require('shib/access_control').AccessControl;\n      // generate cache w/ all engines and databases forcely\n      //  this cache isn't used for the situation configured as auth:require_always\n      shib.client({credential: AccessControl.defaultAllowDelegator()}).engineInfo(function(err, info){\n        if (!err && info)\n          enginesCache = info;\n        this.end();\n      });\n    };\n    setInterval(enginesCacheUpdate, 60*60*1000); // cache update per hour\n    enginesCacheUpdate();\n  });\n}\n\napp.listen(app.get('port'));\n"
  },
  {
    "path": "bin/dbmigrate.js",
    "content": "var async = require('async')\n  , fs = require('fs')\n  , sqlite3 = require('sqlite3');\n\nvar target_db_path = process.argv[2];\nif (! target_db_path) {\n  console.log(\"USAGE: npm run migrate\");\n  console.log(\"   OR: npm run dbmigrate -- DATABASE_FILE_PATH\");\n  console.log(\"     : node bin/dbmigrate.js DATABASE_FILE_PATH (if your npm --version is 1.x)\");\n  process.exit(0);\n}\nvar migrate_db_path = target_db_path + \".migrate\";\n\n/*\nvar SQLITE_TABLE_DEFINITIONS_v0 = [\n  'CREATE TABLE IF NOT EXISTS queries (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS results (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\n];\n*/\n\nvar SQLITE_TABLE_DEFINITIONS_v1 = [\n  '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)',\n  'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\n];\n\nvar on_connect = function(cb){\n  async.series(SQLITE_TABLE_DEFINITIONS_v1.map(function(sql){\n\treturn function(callback) {\n      migrate.run(sql, function(error){\n        if (error) { callback(error.message); return; }\n        callback(null);\n      });\n\t};\n  }), function(err,results){\n\tif (err)\n      throw \"failed to initialize new db file: \" + migrate_db_path;\n    cb();\n  });\n};\n\nvar original;\nvar migrate;\n\nvar open_original = function(cb){\n  original = new sqlite3.Database(target_db_path, sqlite3.OPEN_READONLY, function(err){\n    if (err) { cb(err); return; }\n    cb(null);\n  });\n};\n\nvar close_original = function(cb){\n  original.close(function(){ cb(null); });\n};\n\nvar open_migrate = function(cb){\n  migrate = new sqlite3.Database(migrate_db_path, (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE), function(err){\n    if (err) { cb(err); return; }\n    on_connect(function(){ cb(null); });\n  });\n};\n\nvar close_migrate = function(cb){\n  migrate.close(function(){ cb(null); });\n};\n\nvar migrate_tags = function(cb){\n  original.all('SELECT queryid, tag FROM tags ORDER BY id', function(err, rows){\n    if (err) {\n      cb(err);\n      return;\n    }\n    async.series(rows.map(function(row){\n      return function(cb){\n        migrate.run('INSERT INTO tags (queryid, tag) VALUES (?,?)', [row.queryid, row.tag], function(err){\n          cb(err);\n        });\n      };\n    }), function(err, results){\n      cb(err);\n    });\n  });\n};\n\nvar history = {}; // queryid => true\n\nvar store_history = function(cb){\n  // 'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',\n  original.all('SELECT yyyymm, queryid FROM history', function(err, rows){\n    if (err) { cb(err); return; }\n    var size = rows.length - 1;\n    for (var i = 0 ; i < size ; i++){\n      history[rows[i].queryid] = true;\n    }\n    cb(null);\n  });\n};\n\nvar results = {}; // resultid -> obj\n\nvar store_results = function(cb){\n  original.all('SELECT id, json FROM results', function(err, rows){\n    if (err) { cb(err); return; }\n    var size = rows.length - 1;\n    var row = null;\n    for (var i = 0 ; i < size ; i++){\n      row = rows[i];\n      results[row.id] = row.json;\n    };\n    cb(null);\n  });\n};\n\nvar migrate_queries = function(cb){\n  original.all('SELECT id, json FROM queries', function(err, rows_original){\n    if (err) {\n      cb(err);\n      return;\n    }\n    var rows = rows_original.filter(function(row){\n      var json = row.json;\n      if (json) {\n        var r = JSON.parse(json).results.concat().pop();\n        if (r && results[r.resultid])\n          return true;\n      }\n      return false;\n    }).map(function(row){\n      var obj = JSON.parse(row.json);\n      var result = obj.results.pop();\n      var result_obj = JSON.parse(results[result.resultid]);\n      var state = result_obj['state'];\n      delete result_obj['state'];\n      delete result_obj['queryid'];\n      delete result_obj['resultid'];\n      return {\n        id: row.id,\n        scheduled: (history[row.id] ? 1 : null),\n        engine: obj.engine,\n        dbname: obj.dbname,\n        expression: obj.querystring,\n        state: state,\n        resultid: result.resultid,\n        result_json: JSON.stringify(result_obj),\n        date: new Date(result.executed_at).toJSON()\n      };\n    });\n    rows.sort(function(a, b){ return a.date - b.date; });\n    async.series(rows.map(function(obj){\n      return function(cb) {\n        migrate.run(\n            'INSERT INTO queries (id,datetime,scheduled,engine,dbname,expression,state,resultid,result) VALUES (?,?,?,?,?,?,?,?,?)',\n            [obj.id, obj.date, obj.scheduled, obj.engine, obj.dbname, obj.expression, obj.state, obj.resultid, obj.result_json],\n            function(err){ cb(err); }\n        );\n      };\n    }), function(err, results){ cb(err); });\n  });\n};\n\nasync.series([\n  open_original,\n  open_migrate,\n  migrate_tags,\n  store_history,\n  store_results,\n  migrate_queries,\n  close_original,\n  close_migrate\n], function(err, results){\n  if (err) {\n    console.log(err);\n    throw \"failed to migrate database...\";\n  }\n  fs.renameSync(target_db_path, target_db_path + \".v0\");\n  fs.renameSync(migrate_db_path, target_db_path);\n});\n"
  },
  {
    "path": "bin/purge.js",
    "content": "var async = require('async')\n  , fs = require('fs')\n  , sqlite3 = require('sqlite3');\n\nif (process.argv.length < 4) {\n  console.log(\"USAGE: npm run purge -- DAYS_PURGE_BEFORE\");\n  console.log(\"   OR: node bin/purge.js DATABASE_FILE_PATH DAYS_PURGE_BEFORE (if your npm --version is 1.x)\");\n  console.log(\"\");\n  console.log(\"NOTICE: result data files under DATADIR/results should be removed by yourself.\");\n  console.log(\"        (ex: find var/results -mtime ... | xargs rm)\");\n  process.exit(0);\n}\nvar target_db_path = process.argv[2];\nvar purge_days_before = parseInt(process.argv[3]);\nif (purge_days_before < 3) {\n  console.log(\"ERROR: DAYS_PURGE_BEFORE must be larger than 7, but: \" + process.argv[3]);\n  process.exit(1);\n}\n  \nvar SQLITE_TABLE_DEFINITIONS_v1 = [\n  '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)',\n  'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\n];\n\nvar db = null;\nvar open_db = function(cb){\n  db = new sqlite3.Database(target_db_path, (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE), function(err){\n    cb(err);\n  });\n};\n\nvar close_db = function(cb){\n  db.close(function(){ cb(null); });\n};\n\nvar delete_rows = function(cb){\n  var purge_threshold_datetime = new Date(new Date() - purge_days_before * 1000 * 86400).toJSON();\n  db.run('DELETE FROM queries WHERE datetime < ?', [purge_threshold_datetime], function(err){ cb(err); });\n};\n\nvar vacuum = function(cb){\n  db.run('VACUUM', function(err){ cb(err); });\n};\n\nasync.series([\n  open_db,\n  delete_rows,\n  vacuum,\n  close_db\n], function(err, results){\n  if (err) {\n    console.log(err);\n    throw \"failed to purge old data and vacuum...\";\n  }\n});\n\n"
  },
  {
    "path": "config.js",
    "content": "var servers = exports.servers = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null, // seconds. (null:shib will wait query response infinitely).\n  setup_queries: [],\n  storage: {\n    datadir: './var'\n  },\n  executer: {\n    name: 'hiveserver', // or 'hiveserver2', 'presto', 'bigquery'\n    host: 'localhost',\n    port: 10000,\n    support_database: true,\n    default_database: 'default'\n    /*\n    // If you use 'bigquery' executer, set following values\n    project_id: 'project_id',\n    key_filename: '/path/to/keyfile.json'\n    */\n  },\n  monitor: null\n  /*\n  monitor: {\n    name : 'huahin_mrv1', // or 'presto'\n    host: 'localhost',\n    port: 9010\n  }\n  */\n};\n"
  },
  {
    "path": "examples/hive_beeline_client.js",
    "content": "// NODE_PATH=lib node example/hive_beeline_client.js\n\nvar thrift = require('node-thrift')\n  , ttransport = require('node-thrift/lib/thrift/transport')\n  , TCLIService = require('shib/engines/hiveserver2/TCLIService')\n  , TTypes = require('shib/engines/hiveserver2/TCLIService_types');\n\nvar MaxRows = 10000;\n\nvar fetchOperationResult = function(op, err, res, callback) {\n  console.log({seq:'fetchOperationResult', op:op, err:err, res:res});\n  if (err) { callback(err); return; }\n  if (!res || !res['status'] || res.status['statusCode'] !== 0) {\n    callback({err:'Failed to operate \"' + op + '\"', res:res, status: (res && res['status'] && res.status['statusCode'])});\n    return;\n  }\n  var oph = res.operationHandle;\n  var POLLING_INTERVAL = 50; // 50ms\n  var poller = function(){\n    console.log({seq:'GetOperationStatus', op:op});\n    client.GetOperationStatus(new TTypes.TGetOperationStatusReq({operationHandle:oph}), function(err, res){\n      console.log({seq:'GetOperationStatus', op:op, err:err, res:res});\n      if (err) { callback(err); return; }\n      var statusCode = res && res['status'] && res.status.statusCode;\n      if (statusCode === TTypes.TStatusCode['STILL_EXECUTING_STATUS']) {\n        setTimeout(poller, POLLING_INTERVAL);\n        return;\n      }\n      if (statusCode !== TTypes.TStatusCode['SUCCESS_STATUS'] &&\n          statusCode !== TTypes.TStatusCode['STATUS_WITH_INFO_STATUS']) {\n        if (statusCode === TTypes.TStatusCode['ERROR_STATUS']) {\n          callback({err:'ERROR_STATUS', status:res.status});\n        } else if (statusCode === TTypes.TStatusCode['INVALID_HANDLE_STATUS']) {\n          callback({err:'INVALID_HANDLE_STATUS', status:res.status});\n        } else {\n          callback({err:'UNKNOWN STATUS:' + statusCode, status:res.status});\n        }\n        client.CloseOperation(new TTypes.TCloseOperationReq({operationHandle:oph}), function(err, res){\n          return err || res && res['status'];\n        });\n      }\n\n      /* success */\n      if (res.status.statusCode === TTypes.TStatusCode['STATUS_WITH_INFO_STATUS']) {\n        console.log({req:'withInfoStatus', res:res}); // TODO: what is WITH_INFO_STATUS ?\n      }\n      client.FetchResults(new TTypes.TFetchResultsReq({operationHandle:oph, maxRows:MaxRows}), function(err, res){\n        if (err) { callback(err); return; }\n        console.log({seq:'FetchResults', op:op, err:err, res:res});\n        if (res.hasMoreRows)\n          throw \"Operation hasMoreRow, type:\" + oph.operationType;\n        var results = res.results;\n        client.CloseOperation(new TTypes.TCloseOperationReq({operationHandle:oph}), function(err, res){\n          callback(null, results);\n          return;\n        });\n      });\n    });\n  };\n  setTimeout(poller, POLLING_INTERVAL);\n};\n\n/* hive.server2.authentication='NOSASL' or SASLTransport ... */\nvar connection = thrift.createConnection(\"server.name.local\", 10001, {transport: ttransport.TBufferedTransport, timeout: 600*1000});\nvar client = thrift.createClient(TCLIService, connection);\n\nconnection.on('error', function(err){ console.error(err); });\nconnection.addListener(\"connect\", function(){ console.log(\"connected\"); });\n\nclient.OpenSession(new TTypes.TOpenSessionReq({username: '', password: ''}), function(err,res){\n  var sessionHandle = res.sessionHandle;\n  var treq = new TTypes.TGetTablesReq({sessionHandle:sessionHandle});\n  client.GetTables(treq, function(e,r){ fetchOperationResult('GetTables', e, r, function(err, res){\n    console.log([err, res]);\n    console.log(JSON.stringify(res.rows, null, 4));\n    var sreq = new TTypes.TGetSchemasReq({sessionHandle:sessionHandle});\n    client.GetSchemas(sreq, function(e,r){ fetchOperationResult('GetSchemas', e, r, function(err, res){\n      console.log([err, res]);\n      console.log(JSON.stringify(res.rows, null, 4));\n      var creq = new TTypes.TCloseSessionReq({sessionHandle:sessionHandle});\n      client.CloseSession(creq, function(e,r){ connection.end(); });\n    }); });\n  }); });\n  /*\n  var q = 'select service, count(*) as cnt from access_log where service=\"servic_ename\" and yyyymmdd=\"20130210\" group by service';\n  var req = new TTypes.TExecuteStatementReq({sessionHandle: sessionHandle, statement: q});\n  client.ExecuteStatement(req, function(e,r){ fetchOperationResult('ExecuteStatement', e, r, function(err,rows){\n    console.log({err:err, rows:rows});\n    var creq = new TTypes.TCloseSessionReq({sessionHandle:sessionHandle});\n    client.CloseSession(creq, function(e,r){ connection.end(); });\n  }); });\n   */\n});\n\n/*\nhttp://www.slideshare.net/schubertzhang/hiveserver2/7\n\nExecuteStatement\n  TExecuteStatementReq(sessionHandle, statement, confOverlay)\n  TExecuteStatementResp(status, operationHandle)\n\nGetResultSetMetadata\n  TGetResultSetMetadataReq(operationHandle)\n  TGetResultSetMetadataResp(status, schema)\n\nFetchResults\n  TFetchResultsReq(operationHandle, orientation = 0, maxRows)\n  TFetchResultsResp(status, hasMoreRows, results)\n\nGetCatalogs : \"Catalog: do nothing so far\"\n  TGetCatalogsReq(sessionHandle)\n  TGetCatalogsResp(status, operationHandle)\n\nGetSchemas\n  TGetSchemasReq(sessionHandle, catalogName, schemaName)\n  TGetSchemasResp(status, operationHandle)\n\nGetTableTypes\n  TGetTableTypesReq(sessionHandle)\n  TGetTableTypesResp(status, operationHandle)\n\nGetTables\n  TGetTablesReq(sessionHandle, catalogName, schemaName, tableName, tableTypes)\n  TGetTablesResp(status, operationHandle)\n\nGetColumns\n  TGetColumnsReq(sessionHandle, catalogName, schemaName, tableName, columnName)\n  TGetColumnsResp(status, operationHandle)\n\nGetFunctions\n  TGetFunctionsReq(sessionHandle, catalogName, schemaName, functionName)\n  TGetFunctionsResp(status, operationHandle)\n\nOpenSession\n  TOpenSessionReq(username, password, configuration)\n  TOpenSessionResp(status, serverProtocol, sessionHandle, configuration)\nCloseSession\n  TCloseSessionReq(sessionHandle)\n\nGetInfo\n  TGetInfoReq(sessionHandle, infoType)\n  TGetInfoResp(status, infoValue)\nGetTypeInfo\n  TGetTypeInfoReq(sessionHandle)\n  TGetTypeInfoResp(status, operationHandle)\n\nGetOperationStatus\n  TGetOperationStatusReq(operationHandle)\n  TGetOperationStatusResp(status, operationState)\nGetCancelOperation\n  TCancelOperationReq(operationHandle)\n  TCancelOperationResp(status)\nCloseOperation\n  TCloseOperationReq(operationHandle)\n  TCloseOperationResp(status)\n\n\nオマケ: SessionHandle と OperationHandle\nTSessionHandle(sessionId)\nTOperationHandle(operationId, operationType, hasResultSet, modifiedRowCount) \n */"
  },
  {
    "path": "examples/hive_client.js",
    "content": "var thrift = require('thrift'),\n    ttransport = require('thrift/transport'),\n    ThriftHive = require('./gen-nodejs/ThriftHive');\n\nvar connection = thrift.createConnection(\"localhost\", 10000, {transport: ttransport.TBufferedTransport, timeout: 600*1000}),\n    client = thrift.createClient(ThriftHive, connection);\n\nconnection.on('error', function(err) {\n    console.error(err);\n});\n\nconnection.addListener(\"connect\", function() {\n    client.execute('select count(*) from p', function(err){\n        console.error(\"pos\");\n        if (err) { console.error(\"error on execute(): \" + err); process.exit(1); }\n        \n        client.fetchAll(function(err, data){\n            if (err){ console.error(\"error on fetchAll(): \" + err); process.exit(1); }\n            console.error(data);\n            connection.end();\n            process.exit(0);\n        });\n    });\n});\n\n"
  },
  {
    "path": "examples/hive_methods.js",
    "content": "var thrift = require('thrift'),\n    ttransport = require('thrift/transport'),\n    ThriftHive = require('gen-nodejs/ThriftHive');\n\nvar connection = thrift.createConnection(\"localhost\", 10000, {transport: ttransport.TBufferedTransport, timeout: 600*1000}),\n    client = thrift.createClient(ThriftHive, connection);\n\nconnection.on('error', function(err) {\n  console.error(err);\n});\n\nconnection.addListener(\"connect\", function() {\n  client.getClusterStatus(function(err, data){\n    console.log(\"getClusterStatus:\", data);\n    client.execute('select x, count(*) as cnt from p group by x sort by cnt limit 10', function(err){\n      if (err) { console.error(\"error on execute(): \" + err); process.exit(1); }\n\n      client.getQueryPlan(function(err, data){\n        console.log(\"getQueryPlan:\", data);\n        console.log(\"queryplan queryAttributes:\", data.queries[0].queryAttributes);\n        console.log(\"queryplan stageGraph:\", data.queries[0].stageGraph);\n        console.log(\"queryplan stageGraph adjacencyList children:\", data.queries[0].stageGraph.adjacencyList[0].children);\n        console.log(\"queryplan stageList:\", data.queries[0].stageList);\n        console.log(\"queryplan stageList taskList:\", data.queries[0].stageList[0].taskList[0]);\n        console.log(\"queryplan stageList taskList operatorGraph adjacencyList:\", data.queries[0].stageList[0].taskList[0].operatorGraph.adjacencyList);\n\n        client.getSchema(function(err, data){\n          console.log(\"getSchema:\", data);\n          client.getThriftSchema(function(err,data){\n            console.log(\"getThriftSchema:\", data);\n            client.fetchAll(function(err, data){\n              if (err){ console.error(\"error on fetchAll(): \" + err); process.exit(1); }\n              console.log(\"fetchAll:\", data);\n              connection.end();\n              process.exit(0);\n            });\n          });\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "examples/hive_multi_client.js",
    "content": "var thrift = require('thrift'),\n    ttransport = require('thrift/transport'),\n    ThriftHive = require('gen-nodejs/ThriftHive');\n\nvar connection1 = thrift.createConnection(\"localhost\", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}),\n    client1 = thrift.createClient(ThriftHive, connection1);\nvar connection2 = thrift.createConnection(\"localhost\", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}),\n    client2 = thrift.createClient(ThriftHive, connection2);\n\nconnection1.on('error', function(err){ console.error(err); });\nconnection2.on('error', function(err){ console.error(err); });\n\nvar query1 = 'select x, count(*) from p group by x';\nvar query2 = 'select x, count(*) as cnt, \"hoge\" from p group by x sort by cnt desc limit 30';\nvar done1 = false;\nvar done2 = false;\n\nvar run_test = function(conn, client, query, label, wait, callback) {\n  var func = function(){\n    console.log(label, \"executing.\");\n    client.execute(query, function(err){\n      console.log(label, \"executed.\");\n      if (err){ console.error(label, \"error on execute():\", err); }\n      \n      client.fetchAll(function(err, data){\n        console.log(label, \"fetched.\");\n        if (err){ console.error(label, \"error on fetchAll():\", err); }\n\n        console.log(label, \"result:\", data);\n        callback();\n      });\n    });\n  };\n  conn.addListener(\"connect\", function(){\n    console.log(label, \"connected.\");\n    setTimeout(func, wait);\n  });\n};\n\nrun_test(connection1, client1, query1, \"conn1:\", 5000, function(){ done1 = true; });\nrun_test(connection2, client2, query2, \"conn2:\", 1000, function(){ done2 = true; });\n\nsetInterval(function(){\n  if (done1 && done2){\n    connection1.end();\n    connection2.end();\n    process.exit(0);\n  }\n}, 1000);\n"
  },
  {
    "path": "examples/hive_server2_engine.example.js",
    "content": "var engine = require('shib/engines/hiveserver2');\nvar executer = new engine.Executer({\"name\":\"hiveserver2\", \"host\":\"hiveserver2.server.local\", \"port\":10001});\n\nexecuter.execute(\n    'jobname',\n    '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',\n    function(err, fetcher){\n      console.log({op:'execute', err:err, fetcher:fetcher});\n      if (err) return;\n      fetcher.schema(function(err,schema){\n        if (err) {\n          console.log(JSON.stringify(err, null, \"  \"));\n          return;\n        }\n        console.log(JSON.stringify(schema, null, \"  \"));\n        fetcher.fetch(null, function(err, rows){\n          console.log({op:'fetch', err:err, rows:rows});\n          console.log(JSON.stringify(rows, null, \"  \"));\n        });\n      });\n    }\n);\n\nexecuter.execute(\n    null,\n    'show tables',\n    function(err, fetcher){\n      console.log({op:'execute', err:err, fetcher:fetcher});\n      if (err) {\n        console.log(JSON.stringify(err, null, \"  \"));\n        return;\n      }\n      fetcher.schema(function(err,res){\n        if (err) {\n          console.log(JSON.stringify(err, null, \"  \"));\n          return;\n        }\n        console.log(JSON.stringify(res, null, \"  \"));\n        fetcher.fetch(null, function(err, rows){\n          console.log({op:'fetch', err:err, rows:rows});\n          console.log(JSON.stringify(rows, null, \"  \"));\n        });\n      });\n    }\n);\n\nexecuter.execute(\n    null,\n    'show tables',\n    function(err, fetcher){\n      console.log({op:'execute', err:err, fetcher:fetcher});\n      fetcher.fetch(null, function(err, rows){\n        console.log({op:'fetch', err:err, rows:rows});\n      });\n    }\n);\n\nexecuter.execute(\n    null,\n    'show tables',\n    function(err, fetcher){\n      console.log({op:'execute', err:err, fetcher:fetcher});\n      fetcher.schema(function(err, schema){\n        console.log({op:'schema', err:err, schema:schema});\n        fetcher.fetch(null, function(err, rows){\n          console.log({op:'fetch', err:err, rows:rows});\n        });\n      });\n    }\n);\n"
  },
  {
    "path": "examples/hive_server2_results.js",
    "content": "/*\n * GetTables\n * rows: [ table_items ]\n * table_items: [ ???(catalog?), database(schema?), tablename, tabletype, ??? ]\n */\n/*\n[\n    {\n        \"colVals\": [\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"default\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"access_log\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"MANAGED_TABLE\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": null\n                }\n            }\n        ]\n    },\n    {\n        \"colVals\": [\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"default\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"pageviews\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"MANAGED_TABLE\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": null\n                }\n            }\n        ]\n    },\n    {\n        \"colVals\": [\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"default\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"hourly_log\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"MANAGED_TABLE\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": null\n                }\n            }\n        ]\n    }\n]\n */\n/*\n * GetSchemas\n */\n/*\n[\n    {\n        \"colVals\": [\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"default\"\n                }\n            },\n            {\n                \"boolVal\": null,\n                \"byteVal\": null,\n                \"i16Val\": null,\n                \"i32Val\": null,\n                \"i64Val\": null,\n                \"doubleVal\": null,\n                \"stringVal\": {\n                    \"value\": \"\"\n                }\n            }\n        ]\n    }\n]\n */\n"
  },
  {
    "path": "lib/shib/access_control.js",
    "content": "var AccessControl = exports.AccessControl = function(config){\n  this.default_rule = config['default'] || \"allow\";\n  this.databases = config['databases'] || {};\n};\n\nAccessControl.prototype.allowed = function(tablename, dbname){\n  var dbconf = this.databases[dbname];\n  if (! dbconf)\n    return (this.default_rule === \"allow\");\n  return this.checkDBPrivilege(dbconf, tablename);\n};\n\nAccessControl.prototype.visible = function(dbname){\n  if (! this.databases[dbname])\n    return (this.default_rule === \"allow\");\n\n  // this.databases[dbname] exists\n\n  var dbrule = this.databases[dbname];\n  if (dbrule['default'] === \"deny\" && (dbrule.allow || []).length < 1)\n    // specified db configured db-scope denied\n    return false;\n\n  // visible tables are exists -> db visible\n  return true;\n};\n\nAccessControl.prototype.checkDBPrivilege = function(dbconf, tablename){\n  if (dbconf['default'] === \"allow\") {\n    var deny = dbconf.deny || [];\n    return ( deny.indexOf(tablename) === -1 );\n  } else { // default deny\n    var allow = dbconf.allow || [];\n    return ( allow.indexOf(tablename) >= 0 );\n  }\n};\n\nAccessControl.defaultDenyDelegator = function(){\n  var delegator = new function(){\n    this.allowed = function(t,d){return false;};\n    this.visible = function(d){return false;};\n  };\n  return delegator;\n};\n\nAccessControl.defaultAllowDelegator = function(){\n  var delegator = new function(){\n    this.allowed = function(t,d){return true;};\n    this.visible = function(d){return true;};\n  };\n  return delegator;\n};\n"
  },
  {
    "path": "lib/shib/auth/dumb.js",
    "content": "var Auth = exports.Auth = function(args){\n};\n\nAuth.prototype.check = function(req, callback) {\n  callback(null, {username: req.body.username, password: req.body.password});\n};\n\nAuth.prototype.acl_delegators = function(required_always, username, req) {\n  // allowed(tablename, dbname), visible(dbname)\n  return [function(t,d){return true;}, function(d){return true;}];\n};\n"
  },
  {
    "path": "lib/shib/auth/http_basic_auth.js",
    "content": "var url = require('url')\n  , http = require('http')\n  , https = require('https');\n\nvar AccessControl = require('shib/access_control').AccessControl;\n\nvar Auth = exports.Auth = function(args, logger){\n  this.logger = logger;\n\n  var parsed = {};\n  if (args.url) {\n    parsed = url.parse(args.url);\n    /*\n{ protocol: 'http:',\n  slashes: true,\n  auth: null,\n  host: 'localhost',\n  port: null,\n  hostname: 'localhost',\n  hash: null,\n  search: null,\n  query: null,\n  pathname: '/path',\n  path: '/path',\n  href: 'http://localhost/path' }\n   */\n  }\n\n  this._url = parsed.href || args.url;\n  this._method = args.method || 'GET';\n  this._hostname = args.host || parsed.hostname;\n  this._port = args.port || parsed.port || 80;\n  this._path = args.path || '/'; // including query string\n\n  var protocol = args.protocol || parsed.protocol || 'http';\n  this._client = http;\n  if (protocol === 'https' || protocol === 'https:')\n    this._client = https;\n\n  if (! this._hostname || ! this._path)\n    throw \"basic auth target host/path not speicifed\";\n\n  this._acl_config = args.access_control;\n};\n\nAuth.prototype.check = function(req, callback) {\n  var username = req.body.username;\n  var password = req.body.password;\n\n  if (!username || !password) {\n    callback(null, false);\n    return;\n  }\n\n  var auth_string = username + ':' + password;\n  var options = {\n    hostname: this._hostname,\n    port: this._port,\n    method: this._method,\n    path: this._path,\n    auth: auth_string\n  };\n  var authreq = this._client.request(options, function(res){\n    var success = false;\n    if (res.statusCode == 200) {\n      success = {username: username, password: password};\n    }\n    var waiting = true;\n    res.on('data', function(){\n      if (waiting) {\n        waiting = false;\n        callback(null, success);\n      }\n    });\n  });\n  authreq.on('error', function(e){ callback(e); });\n  authreq.end();\n};\n\n/*\nvar auth = {\n  type: 'http_basic_auth',\n  url: '....',\n  realm: '',\n  access_control: {\n    users: {\n      normal_user_name: {\n        databases: {\n          public: { default: \"allow\" }\n        },\n        default: \"deny\"\n      },\n      super_user_name: {\n        default: \"allow\"\n      }\n    },\n    default: \"allow\" // default\n  },\n};\n*/\n\nAuth.prototype.acl_delegators = function(req, username, options) {\n  var acl_config = null;\n  if (username && this._acl_config && this._acl_config['users'] && this._acl_config['users'][username])\n    acl_config = this._acl_config['users'][username];\n\n  if (!acl_config) {\n    if (options.require_always || this._acl_config && this._acl_config['default'] === 'deny')\n      return [function(t,d){return false;}, function(d){return false;}];\n\n    return [function(t,d){return true;}, function(d){return true;}];\n  }\n  var acl = new AccessControl(acl_config);\n  // allowed(tablename, dbname), visible(dbname)\n  return [function(t,d){return acl.allowed(t,d);}, function(d){return acl.visible(d);}];\n};\n"
  },
  {
    "path": "lib/shib/auth/http_custom_header.js",
    "content": "var AccessControl = require('shib/access_control').AccessControl;\n\n/*\nvar auth = {\n  require_always: true,\n  type: 'http_custom_header',\n  realm: 'linecorp rev',\n  username: 'X-Shib-Auth-User',\n  groupname: 'X-Shib-Auth-Group',\n  access_control: {\n    users: {\n      tagomoris: {\n        default: \"deny\",\n        databases: {\n          default: { default: \"allow\" },\n          legy: { default: \"deny\", allow: [\"access_logs\"] }\n        }\n      },\n      hogepos: {\n        default: \"allow\"\n      }\n    },\n    groups: {\n      supermember: {\n        default: \"allow\"\n      },\n      limitedmember: {\n        default: \"deny\",\n        databases: {\n          default: { default: \"allow\" }\n        }\n      }\n    },\n    order: [\"group\", \"user\"], //default\n    default: \"deny\"  //default\n  }\n};\n*/\n\nvar Auth = exports.Auth = function(args, logger){\n  this.logger = logger;\n  this.realm = args.realm;\n\n  if (! args.require_always)\n    throw \"Auth 'http_custom_headers' does not permit 'require_always: false'\";\n\n  if (! args.username)\n    throw \"Auth 'http_custom_headers' requires username\";\n\n  this._username = args.username;\n  this._groupname = args.groupname;\n  this._acl_config = args.access_control;\n};\n\nAuth.prototype.check = function(req, callback) {\n  var username = req.get(this._username);\n  var groupname = null;\n  if (this._groupname)\n    groupname = req.get(this._groupname);\n\n  if (!username && !groupname) {\n    callback(null, false);\n    return;\n  }\n  callback(null, {username: username});\n};\n\n// On this auth plugin, HTTP custom headers is the most important credential,\n// rather than Shib auth headers.\nAuth.prototype.acl_delegators = function(req, username, options) {\n  // [ allowed(tablename, dbname), visible(dbname) ]\n\n  if (!username)\n    username = req.get(this._username);\n\n  if (!username || username !== req.get(this._username))\n    return [function(t,d){return false;}, function(d){return false;}];\n\n  var groupname = null;\n  if (this._groupname)\n    groupname = req.get(this._groupname);\n\n  var aclconfig = this._acl_config;\n\n  var order = (aclconfig['order'] || [\"group\",\"user\"]);\n  var acl = null;\n  order.forEach(function(order_item){\n    if (acl)\n      return; // continue\n\n    if (order_item === \"group\") {\n      if (! groupname)\n        return; // continue\n      var gdata = (aclconfig['groups'] || {})[groupname];\n      if (gdata)\n        acl = new AccessControl(gdata);\n\n    } else { // user\n      var udata = (aclconfig['users'] || {})[username];\n      if (udata)\n        acl = new AccessControl(udata);\n    }\n  });\n  if (acl) \n    return [function(t,d){return acl.allowed(t,d);}, function(d){return acl.visible(d);}];\n\n  if (aclconfig['default'] === \"allow\")\n    return [function(t,d){return true;}, function(d){return true;}];\n\n  // default deny\n  return [function(t,d){return false;}, function(d){return false;}];\n};\n"
  },
  {
    "path": "lib/shib/auth.js",
    "content": "var crypto = require('crypto');\n\nvar dumb = require('./auth/dumb')\n  , http_basic_auth = require('./auth/http_basic_auth')\n  , http_custom_header = require('./auth/http_custom_header');\n\nvar CRYPTO_DEFAULT_CIPHER = 'aes192';\n\nvar passphrase = null;\nvar secret = null;\n\nvar Auth = exports.Auth = function(config, logger){\n  this.logger = logger;\n\n  if (!passphrase)\n    passphrase = crypto.pseudoRandomBytes(32).toString('binary');\n  if (!secret)\n    secret = crypto.pseudoRandomBytes(4).toString('hex');\n\n  this._provider = null;\n\n  this.enabled = false;\n  this.require_always = config.require_always || false;\n  this.realm = config.realm || '';\n\n  if (config.type === null || config.type === undefined){\n    this._provider = new dumb.Auth();\n  } else if (config.type === 'http_basic_auth'){\n    this._provider = new http_basic_auth.Auth(config, logger);\n    this.enabled = true;\n  } else if (config.type === 'http_custom_header'){\n    this._provider = new http_custom_header.Auth(config, logger);\n    this.enabled = true;\n  } else {\n    throw \"unknown auth type name:\" + config.type;\n  }\n};\n\nAuth.prototype.check = function(req, callback){\n  this._provider.check(req, callback);\n};\n\nAuth.prototype.credential = function(req){\n  var user = this.userdata(req);\n  var username = null;\n  if (user)\n    username = user.username;\n  return new Credential(this._provider.acl_delegators(req, username, {require_always: this.require_always}));\n};\n\nAuth.prototype.userdata = function(req){\n  var data = req.body.authInfo || req.get('X-Shib-AuthInfo');\n  if (!data)\n    return null;\n  return this.decrypto(data);\n};\n\nAuth.prototype.crypto = function(username){\n  var cipher = crypto.createCipher(CRYPTO_DEFAULT_CIPHER, passphrase);\n  var data = secret + ':' + String(username);\n  var buf0 = cipher.update(data, 'utf8', 'hex');\n  var buf1 = cipher.final('hex');\n  return buf0 + buf1;\n};\n\nAuth.prototype.decrypto = function(data){\n  var user;\n  var decipher = crypto.createDecipher(CRYPTO_DEFAULT_CIPHER, passphrase);\n  var r0 = decipher.update(data, 'hex', 'utf8');\n  try {\n    var r1 = decipher.final('utf8');\n    var ary = (r0 + r1).split(':');\n    if (ary[0] === secret) {\n      user = ary[1];\n    }\n  } catch (x) {\n    // TypeError: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt\n    // decrypt error\n  }\n  if (!user)\n    return null;\n  return {username: user};\n};\n\nvar Credential = function(acl_delegators){\n  this.allowed_delegator = acl_delegators[0];\n  this.visible_delegator = acl_delegators[1];\n};\n\nCredential.prototype.allowed = function(tablename, dbname){\n  return this.allowed_delegator(tablename, dbname);\n};\n\nCredential.prototype.visible = function(dbname){\n  return this.visible_delegator(dbname);\n};\n"
  },
  {
    "path": "lib/shib/client.js",
    "content": "var Query = require('./query').Query;\n\nvar async = require('async');\n\nvar localdiskstore = require('./localdiskstore'),\n    LocalDiskStoreError = localdiskstore.LocalStoreError;\nvar engine = require('./engine');\n\nvar FETCH_LINES_DEFAULT = 1000;\n\nvar Client = exports.Client = function(args, logger, credential){\n  var self = this;\n\n  this.logger = logger;\n  this._conf = args;\n  this._localstore = undefined;\n\n  /*\n   * engine configurations defaults\n   *   fetch_lines: 1000,\n   *   query_timeout: null,\n   *   setup_queries: [],\n   *   setup_queries_auth: [],\n   *   max_result_file_byte_size: null,\n   *   default_database: 'default',\n   *\n   * these may be overwritten by each engine configurations\n   */\n\n  this._default_fetch_lines = this._conf.fetch_lines || FETCH_LINES_DEFAULT;\n  this._default_query_timeout = this._conf.query_timeout || null;\n  this._default_setup_queries = this._conf.setup_queries || [];\n  this._default_setup_queries_auth = this._conf.setup_queries_auth || [];\n  this._default_max_result_file_byte_size = this._conf.max_result_file_byte_size || null;\n  this._default_default_database = this._conf.default_database || 'default';\n\n  this._default_engine_label = undefined;\n  this._engine_configs = {};\n  this._engines = {};\n\n  if (this._conf.executer) {\n    this._default_engine_label = 'default';\n    var engine_conf = {\n      label: 'default',\n      executer: this._conf.executer,\n      monitor: this._conf.monitor\n    };\n    this._engine_configs['default'] = engine_conf;\n    this._conf.engines = [engine_conf];\n  }\n  else if (this._conf.engines) {\n    this._default_engine_label = this._conf.engines[0].label;\n\n    this._conf.engines.forEach(function(e){\n      if (! e.label)\n        throw \"label missing in engines configuration!\";\n      if (! e.executer)\n        throw \"executer not found in engines configuration!\";\n\n      self._engine_configs[e.label] = e;\n    });\n  }\n  else\n    throw \"engines configuration missing\";\n\n  this.localStore(); // to initialize sqlite3 database\n\n  this.auth_credential = credential;\n};\n\nfunction error_callback(name, t, callback, err, data){\n  if (! callback) return;\n  if (data && data['ERROR'])\n    err.message += ' ERROR:' + data['ERROR'];\n  callback.apply(t, [err]);\n};\n\nClient.prototype.localStore = function(){\n  if (this._localstore) {\n    return this._localstore;\n  }\n  this._localstore = new localdiskstore.LocalDiskStore(this._conf.storage.datadir, this.logger);\n  return this._localstore;\n};\n\nClient.prototype.engineLabels = function(){\n  var self = this;\n  var labels = [];\n  this._conf.engines.forEach(function(e){\n    labels.push( e.label );\n  });\n  return labels;\n};\n\nClient.prototype.engineInfo = function(callback){\n  var self = this;\n  var labels = this.engineLabels();\n\n  var response = { monitor: {} };\n  var funclist = [];\n\n  // default engine is head of engineLabels\n  // default database is head of each database lists of engines\n  // we MUST keep orders of engineLabels and database lists\n\n  var dblists = {};\n\n  labels.forEach(function(label){\n    response.monitor[label] = self.engine(label).supports('status');\n\n    funclist.push(function(cb){\n      self.databases(label, function(err,dblist){\n        if (err) { cb(err); return; }\n        dblists[label] = dblist;\n        cb(null);\n      });\n    });\n  });\n\n  async.parallel(funclist, function(err, results){\n    if (err) { error_callback('engineInfo', self, callback, err); return; }\n\n    var pairs = [];\n    labels.forEach(function(label){\n      var part = dblists[label].map(function(dbname){ return [ label, dbname ]; });\n      pairs = pairs.concat(part);\n    });\n    response['pairs'] = pairs;\n\n    callback.apply(self, [err, response]);\n  });\n};\n\nClient.prototype.engine = function(label){\n  if (!label)\n    label = this._default_engine_label;\n\n  if (this._engines[label])\n    return this._engines[label];\n\n  var conf = this._engine_configs[label];\n  if (! conf)\n    return null; // unconfigured engine label\n\n  var executer_conf = conf.executer;\n  var monitor_conf = conf.monitor;\n\n  var options = {\n    query_timeout: this._default_query_timeout,\n    fetch_lines: this._default_fetch_lines,\n    setup_queries: this._default_setup_queries,\n    setup_queries_auth: this._default_setup_queries_auth,\n    auth_credential: this.auth_credential\n  };\n\n  if (executer_conf.fetch_lines)\n    options.fetch_lines = executer_conf.fetch_lines;\n  if (executer_conf.query_timeout)\n    options.query_timeout = executer_conf.query_timeout;\n  if (executer_conf.setup_queries)\n    options.setup_queries = executer_conf.setup_queries;\n  if (executer_conf.setup_queries_auth)\n    options.setup_queries_auth = executer_conf.setup_queries_auth;\n\n  if (! executer_conf.default_database)\n    executer_conf.default_database = this._default_default_database;\n\n  this._engines[label] = new engine.Engine(label, executer_conf, monitor_conf, options, this.logger);\n  return this._engines[label];\n};\n\nClient.prototype.end = function(half){\n  var client = this;\n  if (this._localstore) {\n    this._localstore.close();\n    this._localstore = undefined;\n  }\n  if (half)\n    return;\n  if (this._engines) {\n    for (var label in this._engines) {\n      this._engines[label].close();\n    }\n    this._engines = undefined;\n  }\n};\n\nClient.prototype.recentQueries = function(num, callback){\n  var client = this;\n  this.localStore().recentQueries(num, function(err, list){\n    if (err) { error_callback('recentQueries', client, callback, err); return; }\n    callback.apply(client, [err, list]);\n  });\n};\n\nClient.prototype.getQuery = function(queryid, callback){\n  var client = this;\n  this.localStore().query(queryid, function(err, data){\n    if (err) { error_callback('getQuery', client, callback, err, data); return; }\n    callback.apply(client, [err, data]);\n  });\n};\nClient.prototype.query = Client.prototype.getQuery;\n\nClient.prototype.getQueries = function(queryids, callback){\n  var client = this;\n  this.localStore().queries(queryids, function(err, list){\n    if (err) { error_callback('getQueries', client, callback, err, list); return; }\n    callback.apply(client, [err, list]);\n  });\n};\nClient.prototype.queries = Client.prototype.getQueries;\n\nClient.prototype.updateQuery = function(query, callback) {\n  var client = this;\n  this.localStore().updateQuery(query, function(err){\n    if (err) { error_callback('updateQuery', client, callback, err); return; }\n    if (callback)\n      callback.apply(client, [err]);\n  });\n};\n\nClient.prototype.createQuery = function(engineLabel, dbname, querystring, scheduled, userdata, callback){\n  var client = this;\n  var seed;\n  var query;\n  try {\n    var rand = Math.floor(Math.random() * 10000);\n    seed = (new Date()).toTimeString() + \";\" + rand.toString(); // for queryid\n    var auth;\n    if(userdata) {\n      auth = true;\n    } else {\n      auth = false;\n    }\n    query = new Query({querystring:querystring, engine: engineLabel, dbname: dbname, scheduled: scheduled, seed: seed, auth: auth});\n  }\n  catch (e) {\n    error_callback('createQuery catch', client, callback, e);\n    return;\n  }\n  client.query(query.queryid, function(err, savedquery){\n    if (!err && savedquery) { callback.apply(client, [err, savedquery]); return; }\n    this.localStore().insertQuery(query, function(err){\n      if (err) { error_callback('createQuery', client, callback, err); return; }\n      callback.apply(client, [err, query]);\n    });\n  });\n};\n\n/*\n * delete query, tag and resultData\n */\nClient.prototype.deleteQuery = function(queryid, callback){\n  var client = this;\n  this.query(queryid, function(err, query){\n    if (err) { callback(err); return; }\n    if (query === null) { error_callback('deleteQuery', client, callback, new Error(\"queryid=\" + queryid + \" is not found in DB.\")); return; }\n    var resultid = query.resultid;\n    async.series([\n      function(cb){ client.localStore().deleteQuery(queryid, function(err){ cb(err); }); },\n      function(cb){ client.localStore().deleteTagForQuery(queryid, function(err){ cb(err); }); },\n      function(cb){ client.localStore().deleteResultData(resultid, function(err){ cb(err); }); }\n    ], function(err, results){ callback(err); });\n  });\n};\n\nClient.prototype.getQueryByResultId = function(resultid, callback){\n  var client = this;\n  this.localStore().queryByResultId(resultid, function(err, data){\n    if (err) { error_callback('getQuery', client, callback, err, data); return; }\n    callback.apply(client, [err, data]);\n  });\n};\n\nClient.prototype.tagList = function(callback){\n  var client = this;\n  this.localStore().tagList(function(err, tags){\n    if (err) { error_callback('tagList', client, callback, err); return; }\n    callback.apply(client, [err, tags]);\n  });\n};\n\nClient.prototype.tags = function(queryid, callback){\n  var client = this;\n  this.localStore().tags(queryid, function(err, tags){\n    if (err) { error_callback('tags', client, callback, err); return; }\n    callback.apply(client, [err, tags]);\n  });\n};\n\nClient.prototype.addTag = function(queryid, tag, callback){\n  var client = this;\n  this.localStore().addTag(queryid, tag, function(err){\n    if (err) { error_callback('addTag', client, callback, err); return; }\n    callback.apply(client, [err]);\n  });\n};\n\nClient.prototype.deleteTag = function(queryid, tag, callback){\n  var client = this;\n  this.localStore().deleteTag(queryid, tag, function(err){\n    if (err) { error_callback('deleteTag', client, callback, err); return; }\n    callback.apply(client, [err]);\n  });\n};\n\nClient.prototype.taggedQueries = function(tag, callback){\n  var client = this;\n  this.localStore().taggedQueries(tag, function(err, queryids){\n    if (err) { error_callback('taggedQueries', client, callback, err); return; }\n    callback.apply(client, [err, queryids]);\n  });\n};\n\nClient.prototype.getResultData = function(resultid, callback){\n  var client = this;\n  this.localStore().readResultData(resultid, function(err, data){\n    if (err) { error_callback('getResultData', client, callback, err, data); return; }\n\n    var list = [];\n    data.split(\"\\n\").forEach(function(line){\n      if (line == \"\")\n        return;\n      list.push(line.split(\"\\t\"));\n    });\n    callback.apply(client, [err, list]);\n  });\n};\nClient.prototype.resultData = Client.prototype.getResultData;\n\nClient.prototype.getRawResultData = function(resultid, callback){\n  var client = this;\n  this.localStore().readResultData(resultid, function(err, data){\n    if (err) { error_callback('getRawResultData', client, callback, err, data); return; }\n    callback.apply(client, [err, data]);\n  });\n};\nClient.prototype.rawResultData = Client.prototype.getRawResultData;\n\nClient.prototype.appendResultData = function(resultid, data, callback){\n  var client = this;\n  this.localStore().appendResultData(resultid, data.join(\"\\n\") + \"\\n\", function(err){\n    if (err) { error_callback('appendResultData', client, callback, err); return; }\n    if (callback)\n      callback.apply(client, [err]);\n  });\n};\n\nClient.prototype.databases = function(engineLabel, callback){\n  var client = this;\n  var engine = client.engine(engineLabel);\n  if (! engine) {\n    callback.apply(client, [{message: \"RELOAD page: unknown engine label, \" + engineLabel}]);\n    return;\n  }\n  if (! engine.supports('databases')) {\n    callback.apply(client, [null, ['(default)']]);\n    return;\n  }\n  engine.databases(function(error, data){\n    callback.apply(client, [error, data]);\n  });\n};\n\nClient.prototype.tables = function(engineLabel, dbname, callback){\n  var client = this;\n  var engine = client.engine(engineLabel);\n  if (! engine) {\n    callback.apply(client, [{message: \"RELOAD page: unknown engine label, \" + engineLabel}]);\n    return;\n  }\n  engine.tables(dbname, function(error, data){\n    callback.apply(client, [error, data]);\n  });\n};\n\n/* get partitions of specified table */\nClient.prototype.partitions = function(engineLabel, dbname, tablename, callback){\n  var client = this;\n  var engine = client.engine(engineLabel);\n  if (! engine) {\n    callback.apply(client, [{message: \"RELOAD page: unknown engine label, \" + engineLabel}]);\n    return;\n  }\n  engine.partitions(dbname, tablename, function(error, data){\n    // engine().partitions() returns\n    //   [ 'part1=val1/part2=val2/part3=val3', .... ]\n\n    var partition_nodes = [];\n    var treenodes = {};\n\n    var create_node = function(partition, hasChildren){\n      if (treenodes[partition])\n        return treenodes[partition];\n      var parts = partition.split('/');\n      var leafName = parts.pop();\n      var node = {title: leafName};\n      if (hasChildren) {\n        node.children = [];\n      }\n      if (parts.length > 0) {\n        var parent = create_node(parts.join('/'), true);\n        parent.children.push(node);\n      }\n      else {\n        partition_nodes.push(node);\n      }\n      treenodes[partition] = node;\n      return node;\n    };\n\n    (data || []).forEach(function(partition){\n      create_node(partition);\n    });\n    callback.apply(client, [error, partition_nodes]);\n  });\n};\n\n/* get table schema info */\nClient.prototype.describe = function(engineLabel, dbname, tablename, callback){\n  var client = this;\n  var engine = client.engine(engineLabel);\n  if (! engine) {\n    callback.apply(client, [{message: \"RELOAD page: unknown engine label, \" + engineLabel}]);\n    return;\n  }\n  engine.describe(dbname, tablename, function(error, data){\n    callback.apply(client, [error, data]);\n  });\n};\n\nClient.prototype.giveup = function(query, callback){\n  var client = this;\n\n  query.markAsExecuted({message: 'specified as \"give up\"'});\n  client.updateQuery(query);\n  if (callback)\n    callback.apply(client, [null, query]);\n\n  if (! query.engine){\n    client.end(); // self close after half close\n    return;\n  }\n\n  var engine = client.engine(query.engine);\n  if (! engine) {\n    callback.apply(client, [{message: \"RELOAD page: unknown engine label, \" + query.engine}]);\n    client.end(); // self close after half close\n    return;\n  }\n\n  engine.status(query.queryid, function(err, jobdata){\n    if (err){ // engine doesn't support 'status' or errors with other reason\n      // cannot kill with no status information\n      error_callback('giveup', client, callback, err);\n      client.end(); // self close after half close\n      return;\n    }\n    if (jobdata) {// killed job terminates hive query and executer calls callback with error \"killed by user\"\n      engine.kill(jobdata.jobid, function(err){\n        if (err) {\n          client.logger.error(\"Error on killing job\", {jobid: jobdata.jobid, error: err});\n        }\n        client.end(); // self close after half close\n      });\n    }\n  });\n};\n\nClient.prototype.execute = function(query, args){\n  if (! args)\n    args = {};\n\n  var client = this;\n\n  var executed_time = new Date();\n  //query.state is already running, and resultid/result is set\n  \n  if (args.prepare)\n    args.prepare(query);\n\n  var schemaRow = null;\n\n  var resultLines = 0;\n  var resultBytes = 0;\n  var onerror = null;\n\n  var engine = client.engine(query.engine);\n  if (! engine) {\n    query.markAsExecuted({message: \"RELOAD page: unknown engine label, \" + query.engine});\n    if (args.error)\n      args.error();\n    return;\n  }\n  engine.execute(query.queryid, query.dbname, query.composed(), query.auth, {\n    stopcheck: args.stopCheck,\n    stop: args.stop,\n    complete: function(err){\n      if (err){ onerror = err; }\n      query.markAsExecuted(onerror, resultLines, resultBytes);\n      client.updateQuery(query);\n\n      if (onerror && args.error)\n        args.error();\n      else if (args.success)\n        args.success();\n    },\n    error: function(err){\n      query.markAsExecuted(err);\n      client.updateQuery(query);\n      if (args.error)\n        args.error();\n    },\n    timeout: function(err){\n      var queryid = query.queryid;\n      query.markAsExecuted(err);\n      client.updateQuery(query, function(err){ client.end(true); }); // early half close to close database\n      // DO NOT operate database after here\n      if (engine.supports('status') && engine.supports('kill')) {\n        engine.status(queryid, function(err, jobdata){\n          if (err){\n            if (args.error)\n              args.error();\n            return;\n          }\n          if (jobdata) {// killed job terminates hive query and executer calls callback with error \"killed by user\"\n            engine.kill(jobdata.jobid, function(err){\n              if (err) { client.logger.error(\"Error on killing job\", {jobid: jobdata.jobid, error: err}); }\n              if (args.error)\n                args.error();\n            });\n          }\n        });\n      }\n      else {\n        if (args.error)\n          args.error();\n      }\n    },\n    schema: function(error, data){\n      if (error){ onerror = error; return; }\n      query.addSchema(data);\n      // set to write to top of result data\n      schemaRow = data.map(function(f){return f.name.toUpperCase();}).join('\\t');\n    },\n    fetch: function(error, rows, cb){\n      if (error){ onerror = error; cb(error); return; }\n      if (schemaRow) {\n        rows.unshift(schemaRow);\n        schemaRow = null;\n      }\n      client.appendResultData(query.resultid, rows, function(err){\n        if (err) {\n          client.logger.error('failed to append result data', err);\n          cb(err);\n          throw new LocalDiskStoreError(\"failed to append result data\");\n        }\n        resultLines += rows.length;\n        resultBytes += rows.reduce(function(prev,v){return prev + v.length + 1;}, 0);\n        if (this._default_max_result_file_byte_size != null && resultBytes > this._default_max_result_file_byte_size) {\n          cb({message:\"Result file size exceeds \" + this._default_max_result_file_byte_size + \" bytes.\"})\n        } else {\n          cb();\n        }\n      });\n    }\n  });\n};\n\nClient.prototype.detailStatus = function(query, callback){\n  var client = this;\n  var engine = client.engine(query.engine);\n  if (! engine) {\n    error_callback('detailStatus', client, callback, {message: \"RELOAD page: unknown engine label, \" + query.engine}); return;\n    return;\n  }\n  engine.status(query.queryid, function(err, status){\n    if (err) { error_callback('detailStatus', client, callback, err); return; }\n    callback.apply(client, [null, status]);\n  });\n};\n\nClient.prototype.generatePath = function(key){\n  return this.localStore().generatePath(key);\n};\n"
  },
  {
    "path": "lib/shib/engine.js",
    "content": "var dummyengine = require('./engines/dummyengine')\n  , dummy = require('./engines/dummy')\n  , hiveserver = require('./engines/hiveserver')\n  , hiveserver2 = require('./engines/hiveserver2')\n  , presto = require('./engines/presto')\n  , jobtracker = require('./engines/jobtracker')\n  , yarn = require('./engines/yarn')\n  , huahin_mrv1 = require('./engines/huahin_mrv1')\n  , bigquery = require('./engines/bigquery');\n\nvar Query = require('./query').Query\n  , AccessControl = require('./access_control').AccessControl;\n\nvar Engine = exports.Engine = function(label, executer_conf, monitor_conf, options, logger) {\n  // query_timeout is for timeout between 'setup' and just after 'execute' callback call.\n\n  this.label = label;\n  this.logger = logger;\n\n  // this._executer = dummyengine.Executer();\n  this._query_timeout = options.query_timeout;\n  this._setup_queries = options.setup_queries;\n  this._setup_queries_auth = options.setup_queries_auth;\n  this._fetch_lines = options.fetch_lines;\n  this._auth_credential = options.auth_credential;\n  this._executer = null;\n  this._monitor = null;\n\n  if (! executer_conf || !executer_conf.name) {\n    throw \"executer configuration or executer name not found\";\n  }\n\n  var executer = null;\n  var monitor = null;\n\n  switch (executer_conf.name) {\n  case 'hiveserver':\n    executer = hiveserver.Executer;\n    break;\n  case 'hiveserver2':\n    executer = hiveserver2.Executer;\n    // monitor = hiveserver2.Monitor;\n    break;\n  case 'presto':\n    executer = presto.Executer;\n    monitor = presto.Monitor; // default monitor\n    break;\n  case 'bigquery':\n    executer = bigquery.Executer;\n    monitor = bigquery.Monitor; // default monitor\n    break;\n  case 'dummy':\n    executer = dummy.Executer;\n    monitor = dummy.Monitor;\n    break;\n  default:\n    throw \"unknown executer name:\" + executer_conf.name;\n  }\n\n  if (! executer_conf.default_database)\n    throw \"BUG: default_database missing in executer_conf\";\n  this._default_dbname = executer_conf.default_database;\n\n  this._executer = new executer(executer_conf, this.logger);\n\n  this._acl_config = executer_conf.access_control || {};\n\n  if (monitor_conf) {\n    if (! monitor_conf.name)\n      throw \"monitor name not found\";\n\n    switch (monitor_conf.name) {\n    case 'jobtracker':\n      monitor = jobtracker.Monitor;\n      break;\n    case 'yarn':\n      monitor = yarn.Monitor;\n      break;\n    case 'huahin_mrv1':\n      monitor = huahin_mrv1.Monitor;\n      break;\n    case 'presto':\n      monitor = presto.Monitor;\n      break;\n    case 'bigquery':\n      monitor = bigquery.Monitor;\n      break;\n    case 'dummy':\n      monitor = dummy.Monitor;\n      break;\n    default:\n      throw \"unknown monitor name:\" + monitor_conf.name;\n    }\n\n    this._monitor = new monitor(monitor_conf, this.logger);\n  } else if (monitor) {\n    // default monitor same with executor\n    this._monitor = new monitor(executer_conf, this.logger);\n  } else {\n    this._monitor = new dummyengine.Monitor();\n  }\n};\n\nEngine.prototype.supports = function(operation) {\n  switch (operation) {\n    case 'jobname':\n    case 'setup':\n    case 'databases':\n    case 'tables':\n    case 'partitions':\n    case 'describe':\n    case 'execute':\n    return this._executer.supports(operation); // executer MUST support setup() and execute()\n    case 'status':\n    case 'kill':\n    return this._monitor.supports(operation); // monitor CAN support status() and kill()\n  }\n  throw \"invalid operation for engines:\" + operation;\n};\n\nEngine.prototype.acl = function(){\n  if (this._acl_config['delegate'] === 'auth') {\n    if (! this._auth_credential) {\n      this.logger.warn(\"auth credential not found: default denied for all requests\");\n      return AccessControl.defaultDenyDelegator();\n    }\n    return this._auth_credential;\n  }\n  return new AccessControl(this._acl_config);\n};\n\nEngine.prototype.close = function(){\n  this._executer.end();\n  this._executer = undefined;\n  this._monitor.end();\n  this._monitor = undefined;\n};\n\nEngine.prototype.default_database_name = function(){\n  if (this.supports('database'))\n    return this._default_dbname;\n  return null;\n};\n\nEngine.prototype.databases = function(callback){\n  var self = this;\n  if (this.supports('databases')) {\n    this._executer.databases(function(err, dbnamelist){\n      if (err) { self.logger.error('databases', err); callback(err); return; }\n\n      var dbs = [self._default_dbname];\n\n      dbnamelist.forEach(function(dbname){\n        if (dbname === self._default_dbname)\n          return;\n        if (self.acl().visible(dbname))\n          dbs.push(dbname);\n      });\n\n      callback(null, dbs);\n    });\n  } else {\n    callback({message:'Failed to get database list, not supported'});\n  }\n};\n\nEngine.prototype.tables = function(dbname, callback){\n  var self = this;\n  if (this.supports('tables')) {\n    if (! this.acl().visible(dbname)) {\n      callback(null, []);\n      return;\n    }\n    this._executer.tables(dbname, function(err, data){\n      var tables = [];\n      data.forEach(function(tablename){\n        if (self.acl().allowed(tablename, dbname))\n          tables.push(tablename);\n      });\n      callback(null, tables);\n    });\n  } else {\n    callback({message:'Failed to get table list, not supported'});\n  }\n};\n\nEngine.prototype.partitions = function(dbname, tablename, callback){\n  if (this.supports('partitions')) {\n    if (! this.acl().allowed(tablename, dbname)) {\n      callback({message:'access denied'});\n      return;\n    }\n    this._executer.partitions(dbname, tablename, callback);\n  } else {\n    callback({message:'Failed to get partition list, not supported'});\n  }\n};\n\nEngine.prototype.describe = function(dbname, tablename, callback){\n  if (this.supports('describe')) {\n    if (! this.acl().allowed(tablename, dbname)) {\n      callback({message:'access denied'});\n      return;\n    }\n    this._executer.describe(dbname, tablename, callback);\n  } else {\n    callback({message:'Failed to get table schema, not supported'});\n  }\n};\n\n/*\noptions: {\n  schema: function(error, data){},\n  callback: function(error, rows){}, // default callback (exclusive with error/success/fetch/complete)\n  stopcheck: function(query){},\n  stop: function(){},\n  error: function(error){},\n  fetch: function(error, rows){},\n  complete: function(error){},\n  success: function(){} // without fetchNum, fetchAll() -> success_callback(result_rows) (or callback(null,result_rows) )\n}\n */\nEngine.prototype.execute = function(queryid, dbname, query, auth, options) {\n  var self = this;\n\n  var executer = this._executer;\n\n  if (options.call) { // 3rd argument is single callback function\n    var callback = options;\n    options = {callback: callback};\n  }\n\n  var schema_callback = options.schema || function(err,data){};\n\n  var stopcheck = options.stopcheck || function(){return false;};\n  var success_callback = options.success || options.callback || function(err,data){};\n\n  var stop_callback = options.stop || options.callback || function(err,data){};\n\n  var error_callback = options.error || options.callback || function(err){};\n  // query_timeout is for timeout between 'setup' and just after 'execute' callback call.\n  var timeout_callback = options.timeout || error_callback || function(err){};\n\n  var setups = this._setup_queries || [];\n  if(auth) {\n    setups = setups.concat(this._setup_queries_auth)\n  }\n  var fetchnum = this._fetch_lines;\n\n  var fetch_callback = null;\n  var complete_callback = null;\n  if (fetchnum) {\n    if (!options.fetch || !options.complete)\n      throw \"missing fetch or complete callback for fetch api\";\n    fetch_callback = options.fetch;\n    complete_callback = options.complete;\n  }\n\n  var timeout_watch = null;\n  var disable_timeout_handler = function(){\n    if(timeout_watch && timeout_watch.state) {\n      timeout_watch.state = false;\n      clearTimeout(timeout_watch.timer);\n    }\n  };\n  if (this._query_timeout) {\n    var timeout_seconds = this._query_timeout * 1000;\n    var timer = setTimeout(function(){\n      if (timeout_watch && timeout_watch.state) {\n        timeout_watch.expired = true;\n        timeout_callback({message: 'query is expired with configured timeout seconds (' + String(timeout_seconds) + ')'});\n      }\n    }, timeout_seconds);\n    var state = true; // not expired\n    timeout_watch = { timer:timer, state:state, expired:false };\n  }\n\n  var table_db_pairs = Query.parseTableNames(query);\n  var access_denied = false;\n  table_db_pairs.forEach(function(pair){\n    if (! self.acl().allowed(pair[0], (pair[1] || dbname)))\n      access_denied = true;\n  });\n\n  if (access_denied) {\n    disable_timeout_handler();\n    error_callback({message: \"access denied for db/table\"});\n    return;\n  }\n\n  executer.setup(setups, function(err){\n    var jobname = executer.jobname(queryid);\n    executer.execute(jobname, dbname, query, function(err, fetcher){\n      if (timeout_watch && timeout_watch.expired) {\n        // this query has expired, and timeout_callback() has already been executed\n        return;\n      }\n      if (stopcheck()) { disable_timeout_handler(); stop_callback({message: \"stopped by stopcheck\"}); return; }\n      if (err) {         disable_timeout_handler(); error_callback(err); return; }\n\n      fetcher.schema(function(err, data){\n        if (err) { disable_timeout_handler(); error_callback(err); return; }\n\n        if (timeout_watch && timeout_watch.expired) {\n          // this query has expired, and timeout_callback() has already been executed\n          return;\n        }\n\n        disable_timeout_handler();\n\n        if (schema_callback)\n          schema_callback(err, data);\n\n        // fetch all result rows at once\n        if (! fetchnum) {\n          fetcher.fetch(null, function(err, rows){ // fetch all records\n            if (err) { error_callback(err); return; }\n            success_callback(null, rows);\n          });\n          return;\n        }\n\n        var has_errors = false;\n        // fetch N-rows step by step\n        var continuous_fetch = function(err){\n          if (err) {\n            has_errors = true;\n            self.logger.warn(\"fetch killed with upper layer error\", {err: err});\n            complete_callback({message:\"Fetching exits with errors. \" + err.message});\n            return;\n          }\n\n          fetcher.fetch(fetchnum, function(err, rows){\n            if (err) {\n              has_errors = true;\n              self.logger.warn(\"fetch error\", {err: err});\n            }\n\n            if (stopcheck()) { stop_callback({message: \"stopped by stopcheck\"}); return; }\n\n            if (rows == null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {\n              // end of fetched rows\n              if (has_errors)\n                complete_callback({message:\"HiveQL exits with errors\"});\n              else\n                complete_callback(null);\n              return;\n            }\n            fetch_callback(err, rows, continuous_fetch);\n          });\n        };\n        continuous_fetch(null);\n      });\n    });\n  });\n};\n\nEngine.prototype.status = function(queryid, callback) {\n  var jobname = this._executer.jobname(queryid);\n  if (this.supports('status')) {\n    this._monitor.status(jobname, callback);\n  } else {\n    callback({message:'Failed to get job(' + jobname + ') status, not supported'});\n  }\n};\n\nEngine.prototype.kill = function(jobid, callback) {\n  if (this.supports('kill')) {\n    this._monitor.kill(jobid, callback);\n  } else {\n    callback({message:'Failed to kill job(jobid:' + jobid + '), not supported'});\n  }\n};\n"
  },
  {
    "path": "lib/shib/engines/bigquery/index.js",
    "content": "var gcloud = require('gcloud')\n  , util = require('util');\n\n// check interval for real queries, not system queries\nvar BLOCK_CHECK_INTERVAL = 1000; // 1sec\nvar MAX_RESULTS_FOR_EACH_FETCH = 1000;\n\nvar jobname_jobid_map = {};\n\nvar Executer = exports.Executer = function(conf, logger){\n  if (conf.name !== 'bigquery')\n    throw \"executer name mismatch for bigquery:\" + conf.name;\n  if (!conf.project_id)\n    throw \"project_id MUST be specified for bigquery executer\";\n  if (!conf.key_filename)\n    throw \"key_filename MUST be specified for bigquery executer\";\n\n  this.logger = logger;\n  this._client = gcloud.bigquery({\n    projectId: conf.project_id,\n    keyFilename: conf.key_filename\n  });\n};\n\nExecuter.prototype.end = function(){\n  // Nothing to do for HTTP API :-)\n};\n\nExecuter.prototype.supports = function(operation){\n  switch (operation) { // \"executer\" methods\n  case 'jobname':\n  case 'setup':\n  case 'databases':\n  case 'tables':\n  case 'describe':\n  case 'execute':\n    return true;\n  }\n  throw \"unknown operation name (for bigquery):\" + operation;\n};\n\nExecuter.prototype.jobname = function(queryid) {\n  return 'shib-bigquery-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  callback(null);\n};\n\nExecuter.prototype.databases = function(callback){\n  var results = []\n    , pageToken = null\n    , self = this;\n\n  var processDatasets = function(datasets) {\n    datasets.forEach(function(row) {\n      var dbname = row.metadata.datasetReference.datasetId;\n      results.push(dbname);\n    });\n  };\n\n  var fetchDatesets = function() {\n    self._client.getDatasets({ maxResults: MAX_RESULTS_FOR_EACH_FETCH, pageToken: pageToken }, function(err, datasets, nextQuery){\n      if (err) { callback(err); return; }\n\n      processDatasets(datasets);\n\n      if (nextQuery) {\n        pageToken = nextQuery.pageToken;\n        setTimeout(fetchDatesets, 0);\n      } else {\n        callback(null, results);\n      }\n    });\n  };\n  fetchDatesets();\n};\n\nExecuter.prototype.tables = function(dbname, callback){\n  var results = []\n    , pageToken = null\n    , self = this\n    , dataset = self._client.dataset(dbname);\n\n  var processTables = function(tables) {\n    tables.forEach(function(row) {\n      var table = row.metadata.tableReference.tableId;\n      results.push(table);\n    });\n  };\n\n  var fetchTables = function() {\n    dataset.getTables({ maxResults: MAX_RESULTS_FOR_EACH_FETCH, pageToken: pageToken }, function(err, tables, nextQuery){\n      if (err) { callback(err); return; }\n\n      processTables(tables);\n\n      if (nextQuery) {\n        pageToken = nextQuery.pageToken;\n        setTimeout(fetchTables, 0);\n      } else {\n        callback(null, results);\n      }\n    });\n  };\n  fetchTables();\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  // bigquery engine does not support 'partitions'\n  callback(null, []);\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  var dataset = this._client.dataset(dbname);\n  var table = dataset.table(tablename);\n\n  table.getMetadata(function(err, metadata){\n    if (err) { callback(err); return; }\n\n    var results = [];\n    var fields = metadata.schema.fields;\n    fields.forEach(function(field){\n      var name = field.name;\n      var type = field.type;\n      var comment = field.description ? field.description : '';\n      results.push([name, type, comment]);\n    });\n    callback(null, results);\n  });\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  var client = this._client;\n\n  var fetcher = new Fetcher(client, jobname);\n\n  var error_callback = function(e){\n    delete jobname_jobid_map[jobname];\n    if (!fetcher._rpcError) // only first error is stored\n      fetcher._rpcError = e;\n  };\n\n  client.startQuery(query, function(err, job) {\n    if (err) { error_callback(err); return; }\n    jobname_jobid_map[jobname] = job.id;\n  });\n\n  callback(null, fetcher);\n};\n\nvar Fetcher = function(client, jobname){\n  this._client = client;\n  this._jobname = jobname;\n\n  this._hasResults = false;\n  this._noMoreResults = false;\n  this._rpcError = null;\n  this._nextQuery = null;\n\n  this._cache = { data: [], schema: null };\n\n  this._processColumn = function(data){\n    var columns = [];\n    if (data.length > 0) {\n      var first = data[0];\n      Object.keys(first).forEach(function(key){\n        columns.push({ name: key });\n      });\n    }\n    this._cache.schema = columns;\n    this._hasResults = true;\n  };\n\n  this._processData = function(data){\n    var buf = []\n      , len = data.length\n      , schema = this._cache.schema\n      , schemaLen = schema.length;\n\n    for ( var i = 0 ; i < len ; i++ ) {\n      var row = [];\n      for (var j = 0 ; j < schemaLen; j++ ) {\n        row.push(data[i][schema[j].name]);\n      }\n      buf.push( row.join('\\t') );\n    }\n    this._push( buf );\n  };\n\n  this._push = function(data) {\n    this._cache.data = this._cache.data.concat(data);\n  };\n\n  this._waitComplete = function(callback) {\n    if (this._hasResults || this._rpcError) {\n      if (this._rpcError)\n        callback(this._rpcError);\n      else\n        callback(null);\n      return;\n    }\n\n    var self = this;\n    var check = function() {\n      var jobId = jobname_jobid_map[self._jobname];\n      if (jobId) {\n        var job = self._client.job(jobId);\n        job.getQueryResults({\n          maxResults: MAX_RESULTS_FOR_EACH_FETCH,\n          pageToken: self._nextQuery ? self._nextQuery.pageToken : null\n        }, function (err, rows, nextQuery) {\n          if (err) { callback(err); return; }\n\n          if (!self._hasResults) {\n            self._processColumn(rows);\n          }\n          self._processData(rows);\n\n          if (!nextQuery) {\n            self._nextQuery = null;\n            self._noMoreResults = true;\n            delete jobname_jobid_map[self._jobname];\n            return callback(null);\n          }\n\n          self._nextQuery = nextQuery;\n          setTimeout(check, BLOCK_CHECK_INTERVAL);\n        });\n      } else {\n        setTimeout(check, BLOCK_CHECK_INTERVAL);\n      }\n    };\n    check();\n  };\n\n  this.schema = function(callback){\n    /*\n     * schema(callback): callback(err, schema)\n     *  schema: {fieldSchemas: [{name:'fieldname1'}, {name:'fieldname2'}, {name:'fieldname3'}, ...]}\n     *  //?? schema: [{name:'fieldname1'}, {name:'fieldname2'}, ...]\n     */\n    var self = this;\n    this._waitComplete(function(err){\n      if (err) { callback(err); return; }\n      // self._cache.schema: [ { name: \"username\", type: \"varchar\" }, { name: \"cnt\", type: \"bigint\" } ]\n      callback(null, self._cache.schema);\n    });\n  };\n\n  this.fetch = function(num, callback){\n    if (!num) {\n      this._fetchAll(callback);\n      return;\n    }\n\n    var self = this;\n    if (self._cache.data.length < 1 && self._noMoreResults) {\n      // if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {\n      // end of fetched rows\n      callback(null, null);\n      return;\n    }\n\n    var buf = [];\n\n    var fill = function() {\n      var chunk = self._cache.data.splice(0, num - buf.length);\n\n      if (chunk.length < 1) {\n        if (self._noMoreResults) {\n          var tmpbuf = buf;\n          buf = [];\n          callback(null, tmpbuf); // if tmpbuf is empty, this is end of fetching\n          return;\n        }\n        else {\n          setTimeout(fill, BLOCK_CHECK_INTERVAL);\n          return;\n        }\n      }\n\n      buf = buf.concat(chunk);\n      if (buf.length >= num || self._noMoreResults) {\n        var fullchunk = buf;\n        buf = [];\n        callback(null, fullchunk);\n      }\n      else\n        setTimeout(fill, BLOCK_CHECK_INTERVAL);\n    };\n\n    this._waitComplete(function(err){\n      if (err) { callback(err); return; }\n      fill();\n    });\n  };\n\n  this._fetchAll = function(callback) {\n    var self = this;\n    var check = function() {\n      if (self._rpcError)\n        callback(self._rpcError);\n      else if (self._noMoreResults)\n        callback(null, self._cache.data);\n      else\n        setTimeout(check, BLOCK_CHECK_INTERVAL);\n    };\n    check();\n  };\n};\n\nvar Monitor = exports.Monitor = function(conf){\n  if (conf.name !== 'bigquery')\n    throw \"executer name mismatch for bigquery:\" + conf.name;\n  if (!conf.project_id)\n    throw \"project_id MUST be specified for bigquery executer\";\n  if (!conf.key_filename)\n    throw \"key_filename MUST be specified for bigquery executer\";\n\n  this._client = gcloud.bigquery({\n    projectId: conf.project_id,\n    keyFilename: conf.key_filename\n  });\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) { // \"monitor\" methods\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for bigquery.Monitor):\" + operation;\n};\n\nfunction convertStatus(jobname, status) {\n  if (status === undefined) {\n    return null;\n  }\n\n  var retval = {};\n\n  // https://cloud.google.com/bigquery/docs/reference/v2/jobs\n  retval['jobid'] = status['jobReference']['jobId'];\n  retval['name'] = jobname;\n  retval['priority'] = status['configuration']['priority'] || 'INTERACTIVE';\n  retval['state'] = status['status']['state'];\n  retval['trackingURL'] = status['selfLink'];\n\n  retval['startTime'] = new Date(parseInt(status['statistics']['creationTime']));\n  retval['complete'] = (retval['state'] === 'DONE' ? 100 : 0);\n\n  return retval;\n}\n\nMonitor.prototype.status = function(jobname, callback){\n  var jobId = jobname_jobid_map[jobname];\n  if (!jobId) {\n    callback({message:\"job already expired (maybe completed)\"}, null);\n    return;\n  }\n  var job = this._client.job(jobId);\n  job.getMetadata(function(err, data){\n    if (err) { callback(err); return; }\n    callback(null, convertStatus(jobname, data));\n  });\n};\n\nMonitor.prototype.kill = function(query_id, callback){\n  callback(null);\n};\n"
  },
  {
    "path": "lib/shib/engines/dummy/index.js",
    "content": "/*\n * This engine is for development on local environment\n */\n\nvar Executer = exports.Executer = function(conf, logger){\n  if (conf.name !== 'dummy')\n    throw \"executer name mismatch for dummy:\" + conf.name;\n\n  this.logger = logger;\n};\n\nExecuter.prototype.end = function(){\n};\n\nExecuter.prototype.supports = function(operation){\n  switch (operation) { // \"executer\" methods\n  case 'jobname':\n  case 'setup':\n  case 'databases':\n  case 'tables':\n  case 'partitions':\n  case 'describe':\n  case 'execute':\n    return true;\n  }\n  throw \"unknown operation name (for dummy):\" + operation;\n};\n\nExecuter.prototype.jobname = function(queryid) {\n  return 'dummy-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  callback(null);\n};\n\nExecuter.prototype.databases = function(callback){\n  callback(null, [ ['default'], ['dummy1'] ]);\n};\n\nExecuter.prototype.tables = function(dbname, callback){\n  callback(null, [ ['t1'], ['t2'] ]);\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  callback(null, ['f1=1/f2=1', 'f1=1/f2=2', 'f1=2/f2=1', 'f1=2/f2=2']);\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  callback(null, [ ['f1', 'string', ''], ['f2', 'string', ''], ['id', 'bigint', ''], ['json', 'string', ''] ]);\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  callback(null, new Fetcher(this));\n};\n\n/*\n * Fetcher\n *\n * schema(callback): callback(err, schema)\n *  schema: [ { name: 'fieldname1', type: 'typename' }, ...]\n *\n * fetch(num, callback): callback(err, rows)\n *  num: rows to fetch (null == all)\n *  rows: [\"_col1value_\\t_col2value_\\t_col3value_\", \"_col1value_\\t_col2value_\\t_col3value_\", ...]\n *    no more rows exists if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1))\n */\n\nvar Fetcher = function(client){\n  this.schema = function(callback){\n    callback(null, [ {name:\"f1\", type:\"string\"}, {name:\"f2\", type:\"string\"}, {name:\"id\", type:\"bigint\"}, {name:\"json\", type:\"string\"} ]);\n  };\n\n  var finished = false;\n  this.fetch = function(num, callback){\n    // always returns only 4 row after 10 seconds\n    if (finished) {\n      callback(null, []);\n      return;\n    }\n    setTimeout(function(){\n      callback(null, [\"1\\t1\\t1000\\t{}\", \"1\\t2\\t1001\\t{}\", \"2\\t1\\t1002\\t{}\", \"2\\t2\\t1003\\t{}\"]);\n      finished = true;\n    }, 10000);\n  };\n};\n\nvar Monitor = exports.Monitor = function(conf){\n  if (conf.name !== 'dummy')\n    throw \"executer name mismatch for dummy:\" + conf.name;\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) { // \"monitor\" methods\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for dummy.Monitor):\" + operation;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  callback(null, {\n    jobid: \"dummy-id-000001\",\n    name: jobname,\n    priority: \"unknown\",\n    state: \"RUNNING\",\n    trackingURL: \"http://localhost/dummy/\",\n    startTime: new Date().toLocaleString(),\n    mapComplete: null,\n    reduceComplete: null\n  });\n};\n\nMonitor.prototype.kill = function(query_id, callback){\n  callback(null);\n};\n"
  },
  {
    "path": "lib/shib/engines/dummyengine.js",
    "content": "var Executer = exports.Executer = function(){\n  this.supports = function(operation){ return true; };\n};\n\nExecuter.prototype.jobname = function(queryid) {\n  return 'dummy-shib-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  callback(null);\n};\n\nExecuter.prototype.databases = function(callback){\n  callback(null, []); // ['db1', 'db2']\n};\n\nExecuter.prototype.tables = function(dbname, callback){\n  callback(null, []); // ['table1', 'table2']\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  callback(null, []); // ['f1=va1/f2=vb1', 'f1=va1/f2=vb2']\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  callback(null, []); // [ [ 'fieldname', 'type', 'comment' ], ... ]\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  callback(null, new Fetcher());\n};\n\nExecuter.prototype.end = function(){};\n\nvar Fetcher = function(){\n  this.schema = function(callback){ callback(null, []); };\n  this.fetch = function(num, callback){ callback(null, []); };\n};\n/*\n * Fetcher\n *\n * schema(callback): callback(err, schema)\n *  schema: [ { name: 'fieldname1', type: 'typename' }, ...]\n *\n * fetch(num, callback): callback(err, rows)\n *  num: rows to fetch (null == all)\n *  rows: [\"_col1value_\\t_col2value_\\t_col3value_\", \"_col1value_\\t_col2value_\\t_col3value_\", ...]\n *    no more rows exists if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1))\n */\n\nvar Monitor = exports.Monitor = function(){\n  this.supports = function(operation){ return false; };\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  callback(null, {});\n};\n\nMonitor.prototype.kill = function(jobid, callback){\n  callback(null);\n};\n\nMonitor.prototype.end = function(){};\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/FacebookService.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\n\nvar ttypes = require('./fb303_types');\n//HELPER FUNCTIONS AND STRUCTURES\n\nvar FacebookService_getName_args = function(args) {\n};\nFacebookService_getName_args.prototype = {};\nFacebookService_getName_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getName_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getName_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getName_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getName_result.prototype = {};\nFacebookService_getName_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getName_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getName_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getVersion_args = function(args) {\n};\nFacebookService_getVersion_args.prototype = {};\nFacebookService_getVersion_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getVersion_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getVersion_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getVersion_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getVersion_result.prototype = {};\nFacebookService_getVersion_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getVersion_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getVersion_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getStatus_args = function(args) {\n};\nFacebookService_getStatus_args.prototype = {};\nFacebookService_getStatus_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getStatus_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getStatus_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getStatus_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getStatus_result.prototype = {};\nFacebookService_getStatus_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.I32) {\n        this.success = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getStatus_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getStatus_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.I32, 0);\n    output.writeI32(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getStatusDetails_args = function(args) {\n};\nFacebookService_getStatusDetails_args.prototype = {};\nFacebookService_getStatusDetails_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getStatusDetails_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getStatusDetails_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getStatusDetails_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getStatusDetails_result.prototype = {};\nFacebookService_getStatusDetails_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getStatusDetails_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getStatusDetails_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCounters_args = function(args) {\n};\nFacebookService_getCounters_args.prototype = {};\nFacebookService_getCounters_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCounters_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCounters_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCounters_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getCounters_result.prototype = {};\nFacebookService_getCounters_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.MAP) {\n        var _size0 = 0;\n        var _rtmp34;\n        this.success = {};\n        var _ktype1 = 0;\n        var _vtype2 = 0;\n        _rtmp34 = input.readMapBegin();\n        _ktype1 = _rtmp34.ktype;\n        _vtype2 = _rtmp34.vtype;\n        _size0 = _rtmp34.size;\n        for (var _i5 = 0; _i5 < _size0; ++_i5)\n        {\n          if (_i5 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key6 = null;\n          var val7 = null;\n          key6 = input.readString();\n          val7 = input.readI64();\n          this.success[key6] = val7;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCounters_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCounters_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.MAP, 0);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.success));\n    for (var kiter8 in this.success)\n    {\n      if (this.success.hasOwnProperty(kiter8))\n      {\n        var viter9 = this.success[kiter8];\n        output.writeString(kiter8);\n        output.writeI64(viter9);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCounter_args = function(args) {\n  this.key = null;\n  if (args) {\n    if (args.key !== undefined) {\n      this.key = args.key;\n    }\n  }\n};\nFacebookService_getCounter_args.prototype = {};\nFacebookService_getCounter_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.key = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCounter_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCounter_args');\n  if (this.key) {\n    output.writeFieldBegin('key', Thrift.Type.STRING, 1);\n    output.writeString(this.key);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCounter_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getCounter_result.prototype = {};\nFacebookService_getCounter_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.I64) {\n        this.success = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCounter_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCounter_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.I64, 0);\n    output.writeI64(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_setOption_args = function(args) {\n  this.key = null;\n  this.value = null;\n  if (args) {\n    if (args.key !== undefined) {\n      this.key = args.key;\n    }\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nFacebookService_setOption_args.prototype = {};\nFacebookService_setOption_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.key = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.value = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_setOption_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_setOption_args');\n  if (this.key) {\n    output.writeFieldBegin('key', Thrift.Type.STRING, 1);\n    output.writeString(this.key);\n    output.writeFieldEnd();\n  }\n  if (this.value) {\n    output.writeFieldBegin('value', Thrift.Type.STRING, 2);\n    output.writeString(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_setOption_result = function(args) {\n};\nFacebookService_setOption_result.prototype = {};\nFacebookService_setOption_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_setOption_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_setOption_result');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getOption_args = function(args) {\n  this.key = null;\n  if (args) {\n    if (args.key !== undefined) {\n      this.key = args.key;\n    }\n  }\n};\nFacebookService_getOption_args.prototype = {};\nFacebookService_getOption_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.key = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getOption_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getOption_args');\n  if (this.key) {\n    output.writeFieldBegin('key', Thrift.Type.STRING, 1);\n    output.writeString(this.key);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getOption_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getOption_result.prototype = {};\nFacebookService_getOption_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getOption_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getOption_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getOptions_args = function(args) {\n};\nFacebookService_getOptions_args.prototype = {};\nFacebookService_getOptions_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getOptions_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getOptions_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getOptions_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getOptions_result.prototype = {};\nFacebookService_getOptions_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.MAP) {\n        var _size10 = 0;\n        var _rtmp314;\n        this.success = {};\n        var _ktype11 = 0;\n        var _vtype12 = 0;\n        _rtmp314 = input.readMapBegin();\n        _ktype11 = _rtmp314.ktype;\n        _vtype12 = _rtmp314.vtype;\n        _size10 = _rtmp314.size;\n        for (var _i15 = 0; _i15 < _size10; ++_i15)\n        {\n          if (_i15 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key16 = null;\n          var val17 = null;\n          key16 = input.readString();\n          val17 = input.readString();\n          this.success[key16] = val17;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getOptions_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getOptions_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.MAP, 0);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.success));\n    for (var kiter18 in this.success)\n    {\n      if (this.success.hasOwnProperty(kiter18))\n      {\n        var viter19 = this.success[kiter18];\n        output.writeString(kiter18);\n        output.writeString(viter19);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCpuProfile_args = function(args) {\n  this.profileDurationInSec = null;\n  if (args) {\n    if (args.profileDurationInSec !== undefined) {\n      this.profileDurationInSec = args.profileDurationInSec;\n    }\n  }\n};\nFacebookService_getCpuProfile_args.prototype = {};\nFacebookService_getCpuProfile_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.profileDurationInSec = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCpuProfile_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCpuProfile_args');\n  if (this.profileDurationInSec) {\n    output.writeFieldBegin('profileDurationInSec', Thrift.Type.I32, 1);\n    output.writeI32(this.profileDurationInSec);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_getCpuProfile_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_getCpuProfile_result.prototype = {};\nFacebookService_getCpuProfile_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_getCpuProfile_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_getCpuProfile_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_aliveSince_args = function(args) {\n};\nFacebookService_aliveSince_args.prototype = {};\nFacebookService_aliveSince_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_aliveSince_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_aliveSince_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_aliveSince_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nFacebookService_aliveSince_result.prototype = {};\nFacebookService_aliveSince_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.I64) {\n        this.success = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_aliveSince_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_aliveSince_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.I64, 0);\n    output.writeI64(this.success);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_reinitialize_args = function(args) {\n};\nFacebookService_reinitialize_args.prototype = {};\nFacebookService_reinitialize_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_reinitialize_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_reinitialize_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_reinitialize_result = function(args) {\n};\nFacebookService_reinitialize_result.prototype = {};\nFacebookService_reinitialize_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_reinitialize_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_reinitialize_result');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_shutdown_args = function(args) {\n};\nFacebookService_shutdown_args.prototype = {};\nFacebookService_shutdown_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_shutdown_args.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_shutdown_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookService_shutdown_result = function(args) {\n};\nFacebookService_shutdown_result.prototype = {};\nFacebookService_shutdown_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFacebookService_shutdown_result.prototype.write = function(output) {\n  output.writeStructBegin('FacebookService_shutdown_result');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FacebookServiceClient = exports.Client = function(output, pClass) {\n    this.output = output;\n    this.pClass = pClass;\n    this.seqid = 0;\n    this._reqs = {};\n};\nFacebookServiceClient.prototype = {};\nFacebookServiceClient.prototype.getName = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getName();\n};\n\nFacebookServiceClient.prototype.send_getName = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getName', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getName_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getName = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getName_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getName failed: unknown result');\n};\nFacebookServiceClient.prototype.getVersion = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getVersion();\n};\n\nFacebookServiceClient.prototype.send_getVersion = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getVersion', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getVersion_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getVersion = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getVersion_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getVersion failed: unknown result');\n};\nFacebookServiceClient.prototype.getStatus = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getStatus();\n};\n\nFacebookServiceClient.prototype.send_getStatus = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getStatus', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getStatus_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getStatus = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getStatus_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getStatus failed: unknown result');\n};\nFacebookServiceClient.prototype.getStatusDetails = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getStatusDetails();\n};\n\nFacebookServiceClient.prototype.send_getStatusDetails = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getStatusDetails', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getStatusDetails_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getStatusDetails = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getStatusDetails_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getStatusDetails failed: unknown result');\n};\nFacebookServiceClient.prototype.getCounters = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getCounters();\n};\n\nFacebookServiceClient.prototype.send_getCounters = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getCounters', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getCounters_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getCounters = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getCounters_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getCounters failed: unknown result');\n};\nFacebookServiceClient.prototype.getCounter = function(key, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getCounter(key);\n};\n\nFacebookServiceClient.prototype.send_getCounter = function(key) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getCounter', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getCounter_args();\n  args.key = key;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getCounter = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getCounter_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getCounter failed: unknown result');\n};\nFacebookServiceClient.prototype.setOption = function(key, value, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_setOption(key, value);\n};\n\nFacebookServiceClient.prototype.send_setOption = function(key, value) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('setOption', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_setOption_args();\n  args.key = key;\n  args.value = value;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_setOption = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_setOption_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  callback(null)\n};\nFacebookServiceClient.prototype.getOption = function(key, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getOption(key);\n};\n\nFacebookServiceClient.prototype.send_getOption = function(key) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getOption', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getOption_args();\n  args.key = key;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getOption = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getOption_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getOption failed: unknown result');\n};\nFacebookServiceClient.prototype.getOptions = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getOptions();\n};\n\nFacebookServiceClient.prototype.send_getOptions = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getOptions', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getOptions_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getOptions = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getOptions_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getOptions failed: unknown result');\n};\nFacebookServiceClient.prototype.getCpuProfile = function(profileDurationInSec, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getCpuProfile(profileDurationInSec);\n};\n\nFacebookServiceClient.prototype.send_getCpuProfile = function(profileDurationInSec) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getCpuProfile', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_getCpuProfile_args();\n  args.profileDurationInSec = profileDurationInSec;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_getCpuProfile = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_getCpuProfile_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getCpuProfile failed: unknown result');\n};\nFacebookServiceClient.prototype.aliveSince = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_aliveSince();\n};\n\nFacebookServiceClient.prototype.send_aliveSince = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('aliveSince', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_aliveSince_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nFacebookServiceClient.prototype.recv_aliveSince = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new FacebookService_aliveSince_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('aliveSince failed: unknown result');\n};\nFacebookServiceClient.prototype.reinitialize = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_reinitialize();\n};\n\nFacebookServiceClient.prototype.send_reinitialize = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('reinitialize', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_reinitialize_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\nFacebookServiceClient.prototype.shutdown = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_shutdown();\n};\n\nFacebookServiceClient.prototype.send_shutdown = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('shutdown', Thrift.MessageType.CALL, this.seqid);\n  var args = new FacebookService_shutdown_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\nvar FacebookServiceProcessor = exports.Processor = function(handler) {\n  this._handler = handler\n}\nFacebookServiceProcessor.prototype.process = function(input, output) {\n  var r = input.readMessageBegin();\n  if (this['process_' + r.fname]) {\n    return this['process_' + r.fname].call(this, r.rseqid, input, output);\n  } else {\n    input.skip(Thrift.Type.STRUCT);\n    input.readMessageEnd();\n    var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);\n    output.writeMessageBegin(r.fname, Thrift.MessageType.Exception, r.rseqid);\n    x.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  }\n}\n\nFacebookServiceProcessor.prototype.process_getName = function(seqid, input, output) {\n  var args = new FacebookService_getName_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getName_result();\n  this._handler.getName(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getName\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getVersion = function(seqid, input, output) {\n  var args = new FacebookService_getVersion_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getVersion_result();\n  this._handler.getVersion(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getVersion\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getStatus = function(seqid, input, output) {\n  var args = new FacebookService_getStatus_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getStatus_result();\n  this._handler.getStatus(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getStatus\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getStatusDetails = function(seqid, input, output) {\n  var args = new FacebookService_getStatusDetails_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getStatusDetails_result();\n  this._handler.getStatusDetails(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getStatusDetails\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getCounters = function(seqid, input, output) {\n  var args = new FacebookService_getCounters_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getCounters_result();\n  this._handler.getCounters(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getCounters\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getCounter = function(seqid, input, output) {\n  var args = new FacebookService_getCounter_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getCounter_result();\n  this._handler.getCounter(args.key, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getCounter\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_setOption = function(seqid, input, output) {\n  var args = new FacebookService_setOption_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_setOption_result();\n  this._handler.setOption(args.key, args.value, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"setOption\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getOption = function(seqid, input, output) {\n  var args = new FacebookService_getOption_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getOption_result();\n  this._handler.getOption(args.key, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getOption\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getOptions = function(seqid, input, output) {\n  var args = new FacebookService_getOptions_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getOptions_result();\n  this._handler.getOptions(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getOptions\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_getCpuProfile = function(seqid, input, output) {\n  var args = new FacebookService_getCpuProfile_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_getCpuProfile_result();\n  this._handler.getCpuProfile(args.profileDurationInSec, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getCpuProfile\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_aliveSince = function(seqid, input, output) {\n  var args = new FacebookService_aliveSince_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new FacebookService_aliveSince_result();\n  this._handler.aliveSince(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"aliveSince\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nFacebookServiceProcessor.prototype.process_reinitialize = function(seqid, input, output) {\n  var args = new FacebookService_reinitialize_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.reinitialize()\n}\n\nFacebookServiceProcessor.prototype.process_shutdown = function(seqid, input, output) {\n  var args = new FacebookService_shutdown_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.shutdown()\n}\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/ThriftHive.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar fb303_ttypes = require('./fb303_types')\nvar hive_metastore_ttypes = require('./hive_metastore_types')\nvar queryplan_ttypes = require('./queryplan_types')\n\n\nvar ThriftHiveMetastore = require('./ThriftHiveMetastore')\nvar ThriftHiveMetastoreClient = ThriftHiveMetastore.Client\nvar ThriftHiveMetastoreProcessor = ThriftHiveMetastore.Processor\nvar ttypes = require('./hive_service_types');\n//HELPER FUNCTIONS AND STRUCTURES\n\nvar ThriftHive_execute_args = function(args) {\n  this.query = null;\n  if (args) {\n    if (args.query !== undefined) {\n      this.query = args.query;\n    }\n  }\n};\nThriftHive_execute_args.prototype = {};\nThriftHive_execute_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.query = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_execute_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_execute_args');\n  if (this.query) {\n    output.writeFieldBegin('query', Thrift.Type.STRING, 1);\n    output.writeString(this.query);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_execute_result = function(args) {\n  this.ex = null;\n  if (args) {\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_execute_result.prototype = {};\nThriftHive_execute_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_execute_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_execute_result');\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchOne_args = function(args) {\n};\nThriftHive_fetchOne_args.prototype = {};\nThriftHive_fetchOne_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchOne_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchOne_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchOne_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_fetchOne_result.prototype = {};\nThriftHive_fetchOne_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchOne_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchOne_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchN_args = function(args) {\n  this.numRows = null;\n  if (args) {\n    if (args.numRows !== undefined) {\n      this.numRows = args.numRows;\n    }\n  }\n};\nThriftHive_fetchN_args.prototype = {};\nThriftHive_fetchN_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.numRows = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchN_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchN_args');\n  if (this.numRows) {\n    output.writeFieldBegin('numRows', Thrift.Type.I32, 1);\n    output.writeI32(this.numRows);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchN_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_fetchN_result.prototype = {};\nThriftHive_fetchN_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size0 = 0;\n        var _rtmp34;\n        this.success = [];\n        var _etype3 = 0;\n        _rtmp34 = input.readListBegin();\n        _etype3 = _rtmp34.etype;\n        _size0 = _rtmp34.size;\n        for (var _i5 = 0; _i5 < _size0; ++_i5)\n        {\n          var elem6 = null;\n          elem6 = input.readString();\n          this.success.push(elem6);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchN_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchN_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter7 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter7))\n      {\n        iter7 = this.success[iter7];\n        output.writeString(iter7);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchAll_args = function(args) {\n};\nThriftHive_fetchAll_args.prototype = {};\nThriftHive_fetchAll_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchAll_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchAll_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_fetchAll_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_fetchAll_result.prototype = {};\nThriftHive_fetchAll_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size8 = 0;\n        var _rtmp312;\n        this.success = [];\n        var _etype11 = 0;\n        _rtmp312 = input.readListBegin();\n        _etype11 = _rtmp312.etype;\n        _size8 = _rtmp312.size;\n        for (var _i13 = 0; _i13 < _size8; ++_i13)\n        {\n          var elem14 = null;\n          elem14 = input.readString();\n          this.success.push(elem14);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_fetchAll_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_fetchAll_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter15 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter15))\n      {\n        iter15 = this.success[iter15];\n        output.writeString(iter15);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getSchema_args = function(args) {\n};\nThriftHive_getSchema_args.prototype = {};\nThriftHive_getSchema_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getSchema_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getSchema_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getSchema_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_getSchema_result.prototype = {};\nThriftHive_getSchema_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new hive_metastore_ttypes.Schema();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getSchema_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getSchema_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getThriftSchema_args = function(args) {\n};\nThriftHive_getThriftSchema_args.prototype = {};\nThriftHive_getThriftSchema_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getThriftSchema_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getThriftSchema_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getThriftSchema_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_getThriftSchema_result.prototype = {};\nThriftHive_getThriftSchema_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new hive_metastore_ttypes.Schema();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getThriftSchema_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getThriftSchema_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getClusterStatus_args = function(args) {\n};\nThriftHive_getClusterStatus_args.prototype = {};\nThriftHive_getClusterStatus_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getClusterStatus_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getClusterStatus_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getClusterStatus_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_getClusterStatus_result.prototype = {};\nThriftHive_getClusterStatus_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.HiveClusterStatus();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getClusterStatus_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getClusterStatus_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getQueryPlan_args = function(args) {\n};\nThriftHive_getQueryPlan_args.prototype = {};\nThriftHive_getQueryPlan_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getQueryPlan_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getQueryPlan_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_getQueryPlan_result = function(args) {\n  this.success = null;\n  this.ex = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.ex !== undefined) {\n      this.ex = args.ex;\n    }\n  }\n};\nThriftHive_getQueryPlan_result.prototype = {};\nThriftHive_getQueryPlan_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new queryplan_ttypes.QueryPlan();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.ex = new ttypes.HiveServerException();\n        this.ex.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_getQueryPlan_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_getQueryPlan_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.ex) {\n    output.writeFieldBegin('ex', Thrift.Type.STRUCT, 1);\n    this.ex.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_clean_args = function(args) {\n};\nThriftHive_clean_args.prototype = {};\nThriftHive_clean_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_clean_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_clean_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHive_clean_result = function(args) {\n};\nThriftHive_clean_result.prototype = {};\nThriftHive_clean_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHive_clean_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHive_clean_result');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveClient = exports.Client = function(output, pClass) {\n    this.output = output;\n    this.pClass = pClass;\n    this.seqid = 0;\n    this._reqs = {};\n};\nThrift.inherits(ThriftHiveClient, ThriftHiveMetastoreClient)\nThriftHiveClient.prototype.execute = function(query, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_execute(query);\n};\n\nThriftHiveClient.prototype.send_execute = function(query) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('execute', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_execute_args();\n  args.query = query;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_execute = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_execute_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  callback(null)\n};\nThriftHiveClient.prototype.fetchOne = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_fetchOne();\n};\n\nThriftHiveClient.prototype.send_fetchOne = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('fetchOne', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_fetchOne_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_fetchOne = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_fetchOne_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('fetchOne failed: unknown result');\n};\nThriftHiveClient.prototype.fetchN = function(numRows, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_fetchN(numRows);\n};\n\nThriftHiveClient.prototype.send_fetchN = function(numRows) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('fetchN', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_fetchN_args();\n  args.numRows = numRows;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_fetchN = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_fetchN_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('fetchN failed: unknown result');\n};\nThriftHiveClient.prototype.fetchAll = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_fetchAll();\n};\n\nThriftHiveClient.prototype.send_fetchAll = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('fetchAll', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_fetchAll_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_fetchAll = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_fetchAll_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('fetchAll failed: unknown result');\n};\nThriftHiveClient.prototype.getSchema = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getSchema();\n};\n\nThriftHiveClient.prototype.send_getSchema = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getSchema', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_getSchema_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_getSchema = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_getSchema_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getSchema failed: unknown result');\n};\nThriftHiveClient.prototype.getThriftSchema = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getThriftSchema();\n};\n\nThriftHiveClient.prototype.send_getThriftSchema = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getThriftSchema', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_getThriftSchema_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_getThriftSchema = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_getThriftSchema_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getThriftSchema failed: unknown result');\n};\nThriftHiveClient.prototype.getClusterStatus = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getClusterStatus();\n};\n\nThriftHiveClient.prototype.send_getClusterStatus = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getClusterStatus', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_getClusterStatus_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_getClusterStatus = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_getClusterStatus_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getClusterStatus failed: unknown result');\n};\nThriftHiveClient.prototype.getQueryPlan = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_getQueryPlan();\n};\n\nThriftHiveClient.prototype.send_getQueryPlan = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('getQueryPlan', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_getQueryPlan_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_getQueryPlan = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_getQueryPlan_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.ex) {\n    return callback(result.ex);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('getQueryPlan failed: unknown result');\n};\nThriftHiveClient.prototype.clean = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_clean();\n};\n\nThriftHiveClient.prototype.send_clean = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('clean', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHive_clean_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveClient.prototype.recv_clean = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHive_clean_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  callback(null)\n};\nvar ThriftHiveProcessor = exports.Processor = function(handler) {\n  this._handler = handler\n}\nThrift.inherits(ThriftHiveProcessor, ThriftHiveMetastoreProcessor)\nThriftHiveProcessor.prototype.process = function(input, output) {\n  var r = input.readMessageBegin();\n  if (this['process_' + r.fname]) {\n    return this['process_' + r.fname].call(this, r.rseqid, input, output);\n  } else {\n    input.skip(Thrift.Type.STRUCT);\n    input.readMessageEnd();\n    var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);\n    output.writeMessageBegin(r.fname, Thrift.MessageType.Exception, r.rseqid);\n    x.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  }\n}\n\nThriftHiveProcessor.prototype.process_execute = function(seqid, input, output) {\n  var args = new ThriftHive_execute_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_execute_result();\n  this._handler.execute(args.query, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"execute\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_fetchOne = function(seqid, input, output) {\n  var args = new ThriftHive_fetchOne_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_fetchOne_result();\n  this._handler.fetchOne(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"fetchOne\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_fetchN = function(seqid, input, output) {\n  var args = new ThriftHive_fetchN_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_fetchN_result();\n  this._handler.fetchN(args.numRows, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"fetchN\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_fetchAll = function(seqid, input, output) {\n  var args = new ThriftHive_fetchAll_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_fetchAll_result();\n  this._handler.fetchAll(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"fetchAll\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_getSchema = function(seqid, input, output) {\n  var args = new ThriftHive_getSchema_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_getSchema_result();\n  this._handler.getSchema(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getSchema\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_getThriftSchema = function(seqid, input, output) {\n  var args = new ThriftHive_getThriftSchema_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_getThriftSchema_result();\n  this._handler.getThriftSchema(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getThriftSchema\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_getClusterStatus = function(seqid, input, output) {\n  var args = new ThriftHive_getClusterStatus_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_getClusterStatus_result();\n  this._handler.getClusterStatus(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getClusterStatus\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_getQueryPlan = function(seqid, input, output) {\n  var args = new ThriftHive_getQueryPlan_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_getQueryPlan_result();\n  this._handler.getQueryPlan(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"getQueryPlan\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveProcessor.prototype.process_clean = function(seqid, input, output) {\n  var args = new ThriftHive_clean_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHive_clean_result();\n  this._handler.clean(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"clean\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/ThriftHiveMetastore.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar fb303_ttypes = require('./fb303_types')\n\n\nvar FacebookService = require('./FacebookService')\nvar FacebookServiceClient = FacebookService.Client\nvar FacebookServiceProcessor = FacebookService.Processor\nvar ttypes = require('./hive_metastore_types');\n//HELPER FUNCTIONS AND STRUCTURES\n\nvar ThriftHiveMetastore_create_database_args = function(args) {\n  this.database = null;\n  if (args) {\n    if (args.database !== undefined) {\n      this.database = args.database;\n    }\n  }\n};\nThriftHiveMetastore_create_database_args.prototype = {};\nThriftHiveMetastore_create_database_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.database = new ttypes.Database();\n        this.database.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_database_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_database_args');\n  if (this.database) {\n    output.writeFieldBegin('database', Thrift.Type.STRUCT, 1);\n    this.database.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_database_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_create_database_result.prototype = {};\nThriftHiveMetastore_create_database_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.AlreadyExistsException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.InvalidObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_database_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_database_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_database_args = function(args) {\n  this.name = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n  }\n};\nThriftHiveMetastore_get_database_args.prototype = {};\nThriftHiveMetastore_get_database_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_database_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_database_args');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_database_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_database_result.prototype = {};\nThriftHiveMetastore_get_database_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Database();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_database_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_database_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_database_args = function(args) {\n  this.name = null;\n  this.deleteData = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.deleteData !== undefined) {\n      this.deleteData = args.deleteData;\n    }\n  }\n};\nThriftHiveMetastore_drop_database_args.prototype = {};\nThriftHiveMetastore_drop_database_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deleteData = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_database_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_database_args');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.deleteData) {\n    output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 2);\n    output.writeBool(this.deleteData);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_database_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_drop_database_result.prototype = {};\nThriftHiveMetastore_drop_database_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.InvalidOperationException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_database_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_database_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_databases_args = function(args) {\n  this.pattern = null;\n  if (args) {\n    if (args.pattern !== undefined) {\n      this.pattern = args.pattern;\n    }\n  }\n};\nThriftHiveMetastore_get_databases_args.prototype = {};\nThriftHiveMetastore_get_databases_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.pattern = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_databases_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_databases_args');\n  if (this.pattern) {\n    output.writeFieldBegin('pattern', Thrift.Type.STRING, 1);\n    output.writeString(this.pattern);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_databases_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_databases_result.prototype = {};\nThriftHiveMetastore_get_databases_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size196 = 0;\n        var _rtmp3200;\n        this.success = [];\n        var _etype199 = 0;\n        _rtmp3200 = input.readListBegin();\n        _etype199 = _rtmp3200.etype;\n        _size196 = _rtmp3200.size;\n        for (var _i201 = 0; _i201 < _size196; ++_i201)\n        {\n          var elem202 = null;\n          elem202 = input.readString();\n          this.success.push(elem202);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_databases_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_databases_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter203 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter203))\n      {\n        iter203 = this.success[iter203];\n        output.writeString(iter203);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_all_databases_args = function(args) {\n};\nThriftHiveMetastore_get_all_databases_args.prototype = {};\nThriftHiveMetastore_get_all_databases_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_all_databases_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_all_databases_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_all_databases_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_all_databases_result.prototype = {};\nThriftHiveMetastore_get_all_databases_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size204 = 0;\n        var _rtmp3208;\n        this.success = [];\n        var _etype207 = 0;\n        _rtmp3208 = input.readListBegin();\n        _etype207 = _rtmp3208.etype;\n        _size204 = _rtmp3208.size;\n        for (var _i209 = 0; _i209 < _size204; ++_i209)\n        {\n          var elem210 = null;\n          elem210 = input.readString();\n          this.success.push(elem210);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_all_databases_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_all_databases_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter211 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter211))\n      {\n        iter211 = this.success[iter211];\n        output.writeString(iter211);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_database_args = function(args) {\n  this.dbname = null;\n  this.db = null;\n  if (args) {\n    if (args.dbname !== undefined) {\n      this.dbname = args.dbname;\n    }\n    if (args.db !== undefined) {\n      this.db = args.db;\n    }\n  }\n};\nThriftHiveMetastore_alter_database_args.prototype = {};\nThriftHiveMetastore_alter_database_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbname = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.db = new ttypes.Database();\n        this.db.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_database_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_database_args');\n  if (this.dbname) {\n    output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);\n    output.writeString(this.dbname);\n    output.writeFieldEnd();\n  }\n  if (this.db) {\n    output.writeFieldBegin('db', Thrift.Type.STRUCT, 2);\n    this.db.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_database_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_alter_database_result.prototype = {};\nThriftHiveMetastore_alter_database_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_database_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_database_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_type_args = function(args) {\n  this.name = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n  }\n};\nThriftHiveMetastore_get_type_args.prototype = {};\nThriftHiveMetastore_get_type_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_type_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_type_args');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_type_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_type_result.prototype = {};\nThriftHiveMetastore_get_type_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Type();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_type_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_type_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_type_args = function(args) {\n  this.type = null;\n  if (args) {\n    if (args.type !== undefined) {\n      this.type = args.type;\n    }\n  }\n};\nThriftHiveMetastore_create_type_args.prototype = {};\nThriftHiveMetastore_create_type_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.type = new ttypes.Type();\n        this.type.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_type_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_type_args');\n  if (this.type) {\n    output.writeFieldBegin('type', Thrift.Type.STRUCT, 1);\n    this.type.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_type_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_create_type_result.prototype = {};\nThriftHiveMetastore_create_type_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.AlreadyExistsException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.InvalidObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_type_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_type_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_type_args = function(args) {\n  this.type = null;\n  if (args) {\n    if (args.type !== undefined) {\n      this.type = args.type;\n    }\n  }\n};\nThriftHiveMetastore_drop_type_args.prototype = {};\nThriftHiveMetastore_drop_type_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.type = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_type_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_type_args');\n  if (this.type) {\n    output.writeFieldBegin('type', Thrift.Type.STRING, 1);\n    output.writeString(this.type);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_type_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_drop_type_result.prototype = {};\nThriftHiveMetastore_drop_type_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_type_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_type_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_type_all_args = function(args) {\n  this.name = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n  }\n};\nThriftHiveMetastore_get_type_all_args.prototype = {};\nThriftHiveMetastore_get_type_all_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_type_all_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_type_all_args');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_type_all_result = function(args) {\n  this.success = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_type_all_result.prototype = {};\nThriftHiveMetastore_get_type_all_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.MAP) {\n        var _size212 = 0;\n        var _rtmp3216;\n        this.success = {};\n        var _ktype213 = 0;\n        var _vtype214 = 0;\n        _rtmp3216 = input.readMapBegin();\n        _ktype213 = _rtmp3216.ktype;\n        _vtype214 = _rtmp3216.vtype;\n        _size212 = _rtmp3216.size;\n        for (var _i217 = 0; _i217 < _size212; ++_i217)\n        {\n          if (_i217 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key218 = null;\n          var val219 = null;\n          key218 = input.readString();\n          val219 = new ttypes.Type();\n          val219.read(input);\n          this.success[key218] = val219;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_type_all_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_type_all_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.MAP, 0);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.success));\n    for (var kiter220 in this.success)\n    {\n      if (this.success.hasOwnProperty(kiter220))\n      {\n        var viter221 = this.success[kiter220];\n        output.writeString(kiter220);\n        viter221.write(output);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_fields_args = function(args) {\n  this.db_name = null;\n  this.table_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.table_name !== undefined) {\n      this.table_name = args.table_name;\n    }\n  }\n};\nThriftHiveMetastore_get_fields_args.prototype = {};\nThriftHiveMetastore_get_fields_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.table_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_fields_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_fields_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.table_name) {\n    output.writeFieldBegin('table_name', Thrift.Type.STRING, 2);\n    output.writeString(this.table_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_fields_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_get_fields_result.prototype = {};\nThriftHiveMetastore_get_fields_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size222 = 0;\n        var _rtmp3226;\n        this.success = [];\n        var _etype225 = 0;\n        _rtmp3226 = input.readListBegin();\n        _etype225 = _rtmp3226.etype;\n        _size222 = _rtmp3226.size;\n        for (var _i227 = 0; _i227 < _size222; ++_i227)\n        {\n          var elem228 = null;\n          elem228 = new ttypes.FieldSchema();\n          elem228.read(input);\n          this.success.push(elem228);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.UnknownTableException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.UnknownDBException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_fields_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_fields_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter229 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter229))\n      {\n        iter229 = this.success[iter229];\n        iter229.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_schema_args = function(args) {\n  this.db_name = null;\n  this.table_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.table_name !== undefined) {\n      this.table_name = args.table_name;\n    }\n  }\n};\nThriftHiveMetastore_get_schema_args.prototype = {};\nThriftHiveMetastore_get_schema_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.table_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_schema_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_schema_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.table_name) {\n    output.writeFieldBegin('table_name', Thrift.Type.STRING, 2);\n    output.writeString(this.table_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_schema_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_get_schema_result.prototype = {};\nThriftHiveMetastore_get_schema_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size230 = 0;\n        var _rtmp3234;\n        this.success = [];\n        var _etype233 = 0;\n        _rtmp3234 = input.readListBegin();\n        _etype233 = _rtmp3234.etype;\n        _size230 = _rtmp3234.size;\n        for (var _i235 = 0; _i235 < _size230; ++_i235)\n        {\n          var elem236 = null;\n          elem236 = new ttypes.FieldSchema();\n          elem236.read(input);\n          this.success.push(elem236);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.UnknownTableException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.UnknownDBException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_schema_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_schema_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter237 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter237))\n      {\n        iter237 = this.success[iter237];\n        iter237.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_table_args = function(args) {\n  this.tbl = null;\n  if (args) {\n    if (args.tbl !== undefined) {\n      this.tbl = args.tbl;\n    }\n  }\n};\nThriftHiveMetastore_create_table_args.prototype = {};\nThriftHiveMetastore_create_table_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.tbl = new ttypes.Table();\n        this.tbl.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_table_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_table_args');\n  if (this.tbl) {\n    output.writeFieldBegin('tbl', Thrift.Type.STRUCT, 1);\n    this.tbl.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_table_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  this.o4 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n    if (args.o4 !== undefined) {\n      this.o4 = args.o4;\n    }\n  }\n};\nThriftHiveMetastore_create_table_result.prototype = {};\nThriftHiveMetastore_create_table_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.AlreadyExistsException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.InvalidObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o4 = new ttypes.NoSuchObjectException();\n        this.o4.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_table_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_table_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o4) {\n    output.writeFieldBegin('o4', Thrift.Type.STRUCT, 4);\n    this.o4.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_table_args = function(args) {\n  this.dbname = null;\n  this.name = null;\n  this.deleteData = null;\n  if (args) {\n    if (args.dbname !== undefined) {\n      this.dbname = args.dbname;\n    }\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.deleteData !== undefined) {\n      this.deleteData = args.deleteData;\n    }\n  }\n};\nThriftHiveMetastore_drop_table_args.prototype = {};\nThriftHiveMetastore_drop_table_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbname = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deleteData = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_table_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_table_args');\n  if (this.dbname) {\n    output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);\n    output.writeString(this.dbname);\n    output.writeFieldEnd();\n  }\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 2);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.deleteData) {\n    output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 3);\n    output.writeBool(this.deleteData);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_table_result = function(args) {\n  this.o1 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_drop_table_result.prototype = {};\nThriftHiveMetastore_drop_table_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_table_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_table_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 2);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_tables_args = function(args) {\n  this.db_name = null;\n  this.pattern = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.pattern !== undefined) {\n      this.pattern = args.pattern;\n    }\n  }\n};\nThriftHiveMetastore_get_tables_args.prototype = {};\nThriftHiveMetastore_get_tables_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.pattern = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_tables_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_tables_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.pattern) {\n    output.writeFieldBegin('pattern', Thrift.Type.STRING, 2);\n    output.writeString(this.pattern);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_tables_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_tables_result.prototype = {};\nThriftHiveMetastore_get_tables_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size238 = 0;\n        var _rtmp3242;\n        this.success = [];\n        var _etype241 = 0;\n        _rtmp3242 = input.readListBegin();\n        _etype241 = _rtmp3242.etype;\n        _size238 = _rtmp3242.size;\n        for (var _i243 = 0; _i243 < _size238; ++_i243)\n        {\n          var elem244 = null;\n          elem244 = input.readString();\n          this.success.push(elem244);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_tables_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_tables_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter245 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter245))\n      {\n        iter245 = this.success[iter245];\n        output.writeString(iter245);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_all_tables_args = function(args) {\n  this.db_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n  }\n};\nThriftHiveMetastore_get_all_tables_args.prototype = {};\nThriftHiveMetastore_get_all_tables_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_all_tables_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_all_tables_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_all_tables_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_all_tables_result.prototype = {};\nThriftHiveMetastore_get_all_tables_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size246 = 0;\n        var _rtmp3250;\n        this.success = [];\n        var _etype249 = 0;\n        _rtmp3250 = input.readListBegin();\n        _etype249 = _rtmp3250.etype;\n        _size246 = _rtmp3250.size;\n        for (var _i251 = 0; _i251 < _size246; ++_i251)\n        {\n          var elem252 = null;\n          elem252 = input.readString();\n          this.success.push(elem252);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_all_tables_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_all_tables_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter253 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter253))\n      {\n        iter253 = this.success[iter253];\n        output.writeString(iter253);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_table_args = function(args) {\n  this.dbname = null;\n  this.tbl_name = null;\n  if (args) {\n    if (args.dbname !== undefined) {\n      this.dbname = args.dbname;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n  }\n};\nThriftHiveMetastore_get_table_args.prototype = {};\nThriftHiveMetastore_get_table_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbname = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_table_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_table_args');\n  if (this.dbname) {\n    output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);\n    output.writeString(this.dbname);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_table_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_table_result.prototype = {};\nThriftHiveMetastore_get_table_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Table();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_table_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_table_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_table_args = function(args) {\n  this.dbname = null;\n  this.tbl_name = null;\n  this.new_tbl = null;\n  if (args) {\n    if (args.dbname !== undefined) {\n      this.dbname = args.dbname;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.new_tbl !== undefined) {\n      this.new_tbl = args.new_tbl;\n    }\n  }\n};\nThriftHiveMetastore_alter_table_args.prototype = {};\nThriftHiveMetastore_alter_table_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbname = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.new_tbl = new ttypes.Table();\n        this.new_tbl.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_table_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_table_args');\n  if (this.dbname) {\n    output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);\n    output.writeString(this.dbname);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.new_tbl) {\n    output.writeFieldBegin('new_tbl', Thrift.Type.STRUCT, 3);\n    this.new_tbl.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_table_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_alter_table_result.prototype = {};\nThriftHiveMetastore_alter_table_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidOperationException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_table_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_table_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_add_partition_args = function(args) {\n  this.new_part = null;\n  if (args) {\n    if (args.new_part !== undefined) {\n      this.new_part = args.new_part;\n    }\n  }\n};\nThriftHiveMetastore_add_partition_args.prototype = {};\nThriftHiveMetastore_add_partition_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.new_part = new ttypes.Partition();\n        this.new_part.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_add_partition_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_add_partition_args');\n  if (this.new_part) {\n    output.writeFieldBegin('new_part', Thrift.Type.STRUCT, 1);\n    this.new_part.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_add_partition_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_add_partition_result.prototype = {};\nThriftHiveMetastore_add_partition_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.AlreadyExistsException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_add_partition_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_add_partition_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_append_partition_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n  }\n};\nThriftHiveMetastore_append_partition_args.prototype = {};\nThriftHiveMetastore_append_partition_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size254 = 0;\n        var _rtmp3258;\n        this.part_vals = [];\n        var _etype257 = 0;\n        _rtmp3258 = input.readListBegin();\n        _etype257 = _rtmp3258.etype;\n        _size254 = _rtmp3258.size;\n        for (var _i259 = 0; _i259 < _size254; ++_i259)\n        {\n          var elem260 = null;\n          elem260 = input.readString();\n          this.part_vals.push(elem260);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_append_partition_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_append_partition_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter261 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter261))\n      {\n        iter261 = this.part_vals[iter261];\n        output.writeString(iter261);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_append_partition_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_append_partition_result.prototype = {};\nThriftHiveMetastore_append_partition_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.AlreadyExistsException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_append_partition_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_append_partition_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_append_partition_by_name_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_name !== undefined) {\n      this.part_name = args.part_name;\n    }\n  }\n};\nThriftHiveMetastore_append_partition_by_name_args.prototype = {};\nThriftHiveMetastore_append_partition_by_name_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.part_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_append_partition_by_name_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_append_partition_by_name_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_name) {\n    output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);\n    output.writeString(this.part_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_append_partition_by_name_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_append_partition_by_name_result.prototype = {};\nThriftHiveMetastore_append_partition_by_name_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.AlreadyExistsException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_append_partition_by_name_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_append_partition_by_name_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_partition_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  this.deleteData = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n    if (args.deleteData !== undefined) {\n      this.deleteData = args.deleteData;\n    }\n  }\n};\nThriftHiveMetastore_drop_partition_args.prototype = {};\nThriftHiveMetastore_drop_partition_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size262 = 0;\n        var _rtmp3266;\n        this.part_vals = [];\n        var _etype265 = 0;\n        _rtmp3266 = input.readListBegin();\n        _etype265 = _rtmp3266.etype;\n        _size262 = _rtmp3266.size;\n        for (var _i267 = 0; _i267 < _size262; ++_i267)\n        {\n          var elem268 = null;\n          elem268 = input.readString();\n          this.part_vals.push(elem268);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deleteData = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_partition_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_partition_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter269 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter269))\n      {\n        iter269 = this.part_vals[iter269];\n        output.writeString(iter269);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.deleteData) {\n    output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);\n    output.writeBool(this.deleteData);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_partition_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_drop_partition_result.prototype = {};\nThriftHiveMetastore_drop_partition_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_partition_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_partition_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_partition_by_name_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_name = null;\n  this.deleteData = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_name !== undefined) {\n      this.part_name = args.part_name;\n    }\n    if (args.deleteData !== undefined) {\n      this.deleteData = args.deleteData;\n    }\n  }\n};\nThriftHiveMetastore_drop_partition_by_name_args.prototype = {};\nThriftHiveMetastore_drop_partition_by_name_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.part_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deleteData = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_partition_by_name_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_name) {\n    output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);\n    output.writeString(this.part_name);\n    output.writeFieldEnd();\n  }\n  if (this.deleteData) {\n    output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);\n    output.writeBool(this.deleteData);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_partition_by_name_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_drop_partition_by_name_result.prototype = {};\nThriftHiveMetastore_drop_partition_by_name_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_partition_by_name_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_partition_by_name_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_args.prototype = {};\nThriftHiveMetastore_get_partition_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size270 = 0;\n        var _rtmp3274;\n        this.part_vals = [];\n        var _etype273 = 0;\n        _rtmp3274 = input.readListBegin();\n        _etype273 = _rtmp3274.etype;\n        _size270 = _rtmp3274.size;\n        for (var _i275 = 0; _i275 < _size270; ++_i275)\n        {\n          var elem276 = null;\n          elem276 = input.readString();\n          this.part_vals.push(elem276);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter277 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter277))\n      {\n        iter277 = this.part_vals[iter277];\n        output.writeString(iter277);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_result.prototype = {};\nThriftHiveMetastore_get_partition_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_with_auth_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  this.user_name = null;\n  this.group_names = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n    if (args.user_name !== undefined) {\n      this.user_name = args.user_name;\n    }\n    if (args.group_names !== undefined) {\n      this.group_names = args.group_names;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_with_auth_args.prototype = {};\nThriftHiveMetastore_get_partition_with_auth_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size278 = 0;\n        var _rtmp3282;\n        this.part_vals = [];\n        var _etype281 = 0;\n        _rtmp3282 = input.readListBegin();\n        _etype281 = _rtmp3282.etype;\n        _size278 = _rtmp3282.size;\n        for (var _i283 = 0; _i283 < _size278; ++_i283)\n        {\n          var elem284 = null;\n          elem284 = input.readString();\n          this.part_vals.push(elem284);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.user_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.LIST) {\n        var _size285 = 0;\n        var _rtmp3289;\n        this.group_names = [];\n        var _etype288 = 0;\n        _rtmp3289 = input.readListBegin();\n        _etype288 = _rtmp3289.etype;\n        _size285 = _rtmp3289.size;\n        for (var _i290 = 0; _i290 < _size285; ++_i290)\n        {\n          var elem291 = null;\n          elem291 = input.readString();\n          this.group_names.push(elem291);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_with_auth_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_with_auth_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter292 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter292))\n      {\n        iter292 = this.part_vals[iter292];\n        output.writeString(iter292);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.user_name) {\n    output.writeFieldBegin('user_name', Thrift.Type.STRING, 4);\n    output.writeString(this.user_name);\n    output.writeFieldEnd();\n  }\n  if (this.group_names) {\n    output.writeFieldBegin('group_names', Thrift.Type.LIST, 5);\n    output.writeListBegin(Thrift.Type.STRING, this.group_names.length);\n    for (var iter293 in this.group_names)\n    {\n      if (this.group_names.hasOwnProperty(iter293))\n      {\n        iter293 = this.group_names[iter293];\n        output.writeString(iter293);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_with_auth_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_with_auth_result.prototype = {};\nThriftHiveMetastore_get_partition_with_auth_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_with_auth_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_with_auth_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_by_name_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_name !== undefined) {\n      this.part_name = args.part_name;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_by_name_args.prototype = {};\nThriftHiveMetastore_get_partition_by_name_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.part_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_by_name_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_by_name_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_name) {\n    output.writeFieldBegin('part_name', Thrift.Type.STRING, 3);\n    output.writeString(this.part_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_by_name_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_by_name_result.prototype = {};\nThriftHiveMetastore_get_partition_by_name_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Partition();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_by_name_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_by_name_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.max_parts = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_args.prototype = {};\nThriftHiveMetastore_get_partitions_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_result.prototype = {};\nThriftHiveMetastore_get_partitions_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size294 = 0;\n        var _rtmp3298;\n        this.success = [];\n        var _etype297 = 0;\n        _rtmp3298 = input.readListBegin();\n        _etype297 = _rtmp3298.etype;\n        _size294 = _rtmp3298.size;\n        for (var _i299 = 0; _i299 < _size294; ++_i299)\n        {\n          var elem300 = null;\n          elem300 = new ttypes.Partition();\n          elem300.read(input);\n          this.success.push(elem300);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter301 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter301))\n      {\n        iter301 = this.success[iter301];\n        iter301.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_with_auth_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.max_parts = -1;\n  this.user_name = null;\n  this.group_names = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n    if (args.user_name !== undefined) {\n      this.user_name = args.user_name;\n    }\n    if (args.group_names !== undefined) {\n      this.group_names = args.group_names;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_with_auth_args.prototype = {};\nThriftHiveMetastore_get_partitions_with_auth_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.user_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.LIST) {\n        var _size302 = 0;\n        var _rtmp3306;\n        this.group_names = [];\n        var _etype305 = 0;\n        _rtmp3306 = input.readListBegin();\n        _etype305 = _rtmp3306.etype;\n        _size302 = _rtmp3306.size;\n        for (var _i307 = 0; _i307 < _size302; ++_i307)\n        {\n          var elem308 = null;\n          elem308 = input.readString();\n          this.group_names.push(elem308);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_with_auth_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_with_auth_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  if (this.user_name) {\n    output.writeFieldBegin('user_name', Thrift.Type.STRING, 4);\n    output.writeString(this.user_name);\n    output.writeFieldEnd();\n  }\n  if (this.group_names) {\n    output.writeFieldBegin('group_names', Thrift.Type.LIST, 5);\n    output.writeListBegin(Thrift.Type.STRING, this.group_names.length);\n    for (var iter309 in this.group_names)\n    {\n      if (this.group_names.hasOwnProperty(iter309))\n      {\n        iter309 = this.group_names[iter309];\n        output.writeString(iter309);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_with_auth_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_with_auth_result.prototype = {};\nThriftHiveMetastore_get_partitions_with_auth_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size310 = 0;\n        var _rtmp3314;\n        this.success = [];\n        var _etype313 = 0;\n        _rtmp3314 = input.readListBegin();\n        _etype313 = _rtmp3314.etype;\n        _size310 = _rtmp3314.size;\n        for (var _i315 = 0; _i315 < _size310; ++_i315)\n        {\n          var elem316 = null;\n          elem316 = new ttypes.Partition();\n          elem316.read(input);\n          this.success.push(elem316);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_with_auth_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_with_auth_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter317 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter317))\n      {\n        iter317 = this.success[iter317];\n        iter317.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_names_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.max_parts = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_names_args.prototype = {};\nThriftHiveMetastore_get_partition_names_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_names_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_names_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 3);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_names_result = function(args) {\n  this.success = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_names_result.prototype = {};\nThriftHiveMetastore_get_partition_names_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size318 = 0;\n        var _rtmp3322;\n        this.success = [];\n        var _etype321 = 0;\n        _rtmp3322 = input.readListBegin();\n        _etype321 = _rtmp3322.etype;\n        _size318 = _rtmp3322.size;\n        for (var _i323 = 0; _i323 < _size318; ++_i323)\n        {\n          var elem324 = null;\n          elem324 = input.readString();\n          this.success.push(elem324);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_names_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_names_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter325 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter325))\n      {\n        iter325 = this.success[iter325];\n        output.writeString(iter325);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_ps_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  this.max_parts = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_ps_args.prototype = {};\nThriftHiveMetastore_get_partitions_ps_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size326 = 0;\n        var _rtmp3330;\n        this.part_vals = [];\n        var _etype329 = 0;\n        _rtmp3330 = input.readListBegin();\n        _etype329 = _rtmp3330.etype;\n        _size326 = _rtmp3330.size;\n        for (var _i331 = 0; _i331 < _size326; ++_i331)\n        {\n          var elem332 = null;\n          elem332 = input.readString();\n          this.part_vals.push(elem332);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_ps_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter333 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter333))\n      {\n        iter333 = this.part_vals[iter333];\n        output.writeString(iter333);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_ps_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_ps_result.prototype = {};\nThriftHiveMetastore_get_partitions_ps_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size334 = 0;\n        var _rtmp3338;\n        this.success = [];\n        var _etype337 = 0;\n        _rtmp3338 = input.readListBegin();\n        _etype337 = _rtmp3338.etype;\n        _size334 = _rtmp3338.size;\n        for (var _i339 = 0; _i339 < _size334; ++_i339)\n        {\n          var elem340 = null;\n          elem340 = new ttypes.Partition();\n          elem340.read(input);\n          this.success.push(elem340);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_ps_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter341 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter341))\n      {\n        iter341 = this.success[iter341];\n        iter341.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_ps_with_auth_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  this.max_parts = -1;\n  this.user_name = null;\n  this.group_names = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n    if (args.user_name !== undefined) {\n      this.user_name = args.user_name;\n    }\n    if (args.group_names !== undefined) {\n      this.group_names = args.group_names;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype = {};\nThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size342 = 0;\n        var _rtmp3346;\n        this.part_vals = [];\n        var _etype345 = 0;\n        _rtmp3346 = input.readListBegin();\n        _etype345 = _rtmp3346.etype;\n        _size342 = _rtmp3346.size;\n        for (var _i347 = 0; _i347 < _size342; ++_i347)\n        {\n          var elem348 = null;\n          elem348 = input.readString();\n          this.part_vals.push(elem348);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRING) {\n        this.user_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.LIST) {\n        var _size349 = 0;\n        var _rtmp3353;\n        this.group_names = [];\n        var _etype352 = 0;\n        _rtmp3353 = input.readListBegin();\n        _etype352 = _rtmp3353.etype;\n        _size349 = _rtmp3353.size;\n        for (var _i354 = 0; _i354 < _size349; ++_i354)\n        {\n          var elem355 = null;\n          elem355 = input.readString();\n          this.group_names.push(elem355);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_ps_with_auth_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_with_auth_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter356 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter356))\n      {\n        iter356 = this.part_vals[iter356];\n        output.writeString(iter356);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  if (this.user_name) {\n    output.writeFieldBegin('user_name', Thrift.Type.STRING, 5);\n    output.writeString(this.user_name);\n    output.writeFieldEnd();\n  }\n  if (this.group_names) {\n    output.writeFieldBegin('group_names', Thrift.Type.LIST, 6);\n    output.writeListBegin(Thrift.Type.STRING, this.group_names.length);\n    for (var iter357 in this.group_names)\n    {\n      if (this.group_names.hasOwnProperty(iter357))\n      {\n        iter357 = this.group_names[iter357];\n        output.writeString(iter357);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_ps_with_auth_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype = {};\nThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size358 = 0;\n        var _rtmp3362;\n        this.success = [];\n        var _etype361 = 0;\n        _rtmp3362 = input.readListBegin();\n        _etype361 = _rtmp3362.etype;\n        _size358 = _rtmp3362.size;\n        for (var _i363 = 0; _i363 < _size358; ++_i363)\n        {\n          var elem364 = null;\n          elem364 = new ttypes.Partition();\n          elem364.read(input);\n          this.success.push(elem364);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_ps_with_auth_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_ps_with_auth_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter365 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter365))\n      {\n        iter365 = this.success[iter365];\n        iter365.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_names_ps_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.part_vals = null;\n  this.max_parts = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.part_vals !== undefined) {\n      this.part_vals = args.part_vals;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_names_ps_args.prototype = {};\nThriftHiveMetastore_get_partition_names_ps_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size366 = 0;\n        var _rtmp3370;\n        this.part_vals = [];\n        var _etype369 = 0;\n        _rtmp3370 = input.readListBegin();\n        _etype369 = _rtmp3370.etype;\n        _size366 = _rtmp3370.size;\n        for (var _i371 = 0; _i371 < _size366; ++_i371)\n        {\n          var elem372 = null;\n          elem372 = input.readString();\n          this.part_vals.push(elem372);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_names_ps_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.part_vals) {\n    output.writeFieldBegin('part_vals', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.part_vals.length);\n    for (var iter373 in this.part_vals)\n    {\n      if (this.part_vals.hasOwnProperty(iter373))\n      {\n        iter373 = this.part_vals[iter373];\n        output.writeString(iter373);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partition_names_ps_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_partition_names_ps_result.prototype = {};\nThriftHiveMetastore_get_partition_names_ps_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size374 = 0;\n        var _rtmp3378;\n        this.success = [];\n        var _etype377 = 0;\n        _rtmp3378 = input.readListBegin();\n        _etype377 = _rtmp3378.etype;\n        _size374 = _rtmp3378.size;\n        for (var _i379 = 0; _i379 < _size374; ++_i379)\n        {\n          var elem380 = null;\n          elem380 = input.readString();\n          this.success.push(elem380);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partition_names_ps_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partition_names_ps_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter381 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter381))\n      {\n        iter381 = this.success[iter381];\n        output.writeString(iter381);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_by_filter_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.filter = null;\n  this.max_parts = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.filter !== undefined) {\n      this.filter = args.filter;\n    }\n    if (args.max_parts !== undefined) {\n      this.max_parts = args.max_parts;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_by_filter_args.prototype = {};\nThriftHiveMetastore_get_partitions_by_filter_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.filter = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I16) {\n        this.max_parts = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_by_filter_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_by_filter_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.filter) {\n    output.writeFieldBegin('filter', Thrift.Type.STRING, 3);\n    output.writeString(this.filter);\n    output.writeFieldEnd();\n  }\n  if (this.max_parts) {\n    output.writeFieldBegin('max_parts', Thrift.Type.I16, 4);\n    output.writeI16(this.max_parts);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_partitions_by_filter_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_partitions_by_filter_result.prototype = {};\nThriftHiveMetastore_get_partitions_by_filter_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size382 = 0;\n        var _rtmp3386;\n        this.success = [];\n        var _etype385 = 0;\n        _rtmp3386 = input.readListBegin();\n        _etype385 = _rtmp3386.etype;\n        _size382 = _rtmp3386.size;\n        for (var _i387 = 0; _i387 < _size382; ++_i387)\n        {\n          var elem388 = null;\n          elem388 = new ttypes.Partition();\n          elem388.read(input);\n          this.success.push(elem388);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_partitions_by_filter_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_partitions_by_filter_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter389 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter389))\n      {\n        iter389 = this.success[iter389];\n        iter389.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_partition_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.new_part = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.new_part !== undefined) {\n      this.new_part = args.new_part;\n    }\n  }\n};\nThriftHiveMetastore_alter_partition_args.prototype = {};\nThriftHiveMetastore_alter_partition_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.new_part = new ttypes.Partition();\n        this.new_part.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_partition_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_partition_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.new_part) {\n    output.writeFieldBegin('new_part', Thrift.Type.STRUCT, 3);\n    this.new_part.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_partition_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_alter_partition_result.prototype = {};\nThriftHiveMetastore_alter_partition_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidOperationException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_partition_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_partition_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_config_value_args = function(args) {\n  this.name = null;\n  this.defaultValue = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.defaultValue !== undefined) {\n      this.defaultValue = args.defaultValue;\n    }\n  }\n};\nThriftHiveMetastore_get_config_value_args.prototype = {};\nThriftHiveMetastore_get_config_value_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.defaultValue = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_config_value_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_config_value_args');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.defaultValue) {\n    output.writeFieldBegin('defaultValue', Thrift.Type.STRING, 2);\n    output.writeString(this.defaultValue);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_config_value_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_config_value_result.prototype = {};\nThriftHiveMetastore_get_config_value_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.ConfigValSecurityException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_config_value_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_config_value_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_partition_name_to_vals_args = function(args) {\n  this.part_name = null;\n  if (args) {\n    if (args.part_name !== undefined) {\n      this.part_name = args.part_name;\n    }\n  }\n};\nThriftHiveMetastore_partition_name_to_vals_args.prototype = {};\nThriftHiveMetastore_partition_name_to_vals_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.part_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_partition_name_to_vals_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_args');\n  if (this.part_name) {\n    output.writeFieldBegin('part_name', Thrift.Type.STRING, 1);\n    output.writeString(this.part_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_partition_name_to_vals_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_partition_name_to_vals_result.prototype = {};\nThriftHiveMetastore_partition_name_to_vals_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size390 = 0;\n        var _rtmp3394;\n        this.success = [];\n        var _etype393 = 0;\n        _rtmp3394 = input.readListBegin();\n        _etype393 = _rtmp3394.etype;\n        _size390 = _rtmp3394.size;\n        for (var _i395 = 0; _i395 < _size390; ++_i395)\n        {\n          var elem396 = null;\n          elem396 = input.readString();\n          this.success.push(elem396);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_partition_name_to_vals_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_partition_name_to_vals_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter397 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter397))\n      {\n        iter397 = this.success[iter397];\n        output.writeString(iter397);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_partition_name_to_spec_args = function(args) {\n  this.part_name = null;\n  if (args) {\n    if (args.part_name !== undefined) {\n      this.part_name = args.part_name;\n    }\n  }\n};\nThriftHiveMetastore_partition_name_to_spec_args.prototype = {};\nThriftHiveMetastore_partition_name_to_spec_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.part_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_partition_name_to_spec_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_args');\n  if (this.part_name) {\n    output.writeFieldBegin('part_name', Thrift.Type.STRING, 1);\n    output.writeString(this.part_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_partition_name_to_spec_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_partition_name_to_spec_result.prototype = {};\nThriftHiveMetastore_partition_name_to_spec_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.MAP) {\n        var _size398 = 0;\n        var _rtmp3402;\n        this.success = {};\n        var _ktype399 = 0;\n        var _vtype400 = 0;\n        _rtmp3402 = input.readMapBegin();\n        _ktype399 = _rtmp3402.ktype;\n        _vtype400 = _rtmp3402.vtype;\n        _size398 = _rtmp3402.size;\n        for (var _i403 = 0; _i403 < _size398; ++_i403)\n        {\n          if (_i403 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key404 = null;\n          var val405 = null;\n          key404 = input.readString();\n          val405 = input.readString();\n          this.success[key404] = val405;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_partition_name_to_spec_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_partition_name_to_spec_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.MAP, 0);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.success));\n    for (var kiter406 in this.success)\n    {\n      if (this.success.hasOwnProperty(kiter406))\n      {\n        var viter407 = this.success[kiter406];\n        output.writeString(kiter406);\n        output.writeString(viter407);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_add_index_args = function(args) {\n  this.new_index = null;\n  this.index_table = null;\n  if (args) {\n    if (args.new_index !== undefined) {\n      this.new_index = args.new_index;\n    }\n    if (args.index_table !== undefined) {\n      this.index_table = args.index_table;\n    }\n  }\n};\nThriftHiveMetastore_add_index_args.prototype = {};\nThriftHiveMetastore_add_index_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.new_index = new ttypes.Index();\n        this.new_index.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.index_table = new ttypes.Table();\n        this.index_table.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_add_index_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_add_index_args');\n  if (this.new_index) {\n    output.writeFieldBegin('new_index', Thrift.Type.STRUCT, 1);\n    this.new_index.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.index_table) {\n    output.writeFieldBegin('index_table', Thrift.Type.STRUCT, 2);\n    this.index_table.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_add_index_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  this.o3 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n    if (args.o3 !== undefined) {\n      this.o3 = args.o3;\n    }\n  }\n};\nThriftHiveMetastore_add_index_result.prototype = {};\nThriftHiveMetastore_add_index_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Index();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.AlreadyExistsException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o3 = new ttypes.MetaException();\n        this.o3.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_add_index_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_add_index_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o3) {\n    output.writeFieldBegin('o3', Thrift.Type.STRUCT, 3);\n    this.o3.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_index_args = function(args) {\n  this.dbname = null;\n  this.base_tbl_name = null;\n  this.idx_name = null;\n  this.new_idx = null;\n  if (args) {\n    if (args.dbname !== undefined) {\n      this.dbname = args.dbname;\n    }\n    if (args.base_tbl_name !== undefined) {\n      this.base_tbl_name = args.base_tbl_name;\n    }\n    if (args.idx_name !== undefined) {\n      this.idx_name = args.idx_name;\n    }\n    if (args.new_idx !== undefined) {\n      this.new_idx = args.new_idx;\n    }\n  }\n};\nThriftHiveMetastore_alter_index_args.prototype = {};\nThriftHiveMetastore_alter_index_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbname = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.base_tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.idx_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.new_idx = new ttypes.Index();\n        this.new_idx.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_index_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_index_args');\n  if (this.dbname) {\n    output.writeFieldBegin('dbname', Thrift.Type.STRING, 1);\n    output.writeString(this.dbname);\n    output.writeFieldEnd();\n  }\n  if (this.base_tbl_name) {\n    output.writeFieldBegin('base_tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.base_tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.idx_name) {\n    output.writeFieldBegin('idx_name', Thrift.Type.STRING, 3);\n    output.writeString(this.idx_name);\n    output.writeFieldEnd();\n  }\n  if (this.new_idx) {\n    output.writeFieldBegin('new_idx', Thrift.Type.STRUCT, 4);\n    this.new_idx.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_alter_index_result = function(args) {\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_alter_index_result.prototype = {};\nThriftHiveMetastore_alter_index_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.InvalidOperationException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_alter_index_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_alter_index_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_index_by_name_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.index_name = null;\n  this.deleteData = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.index_name !== undefined) {\n      this.index_name = args.index_name;\n    }\n    if (args.deleteData !== undefined) {\n      this.deleteData = args.deleteData;\n    }\n  }\n};\nThriftHiveMetastore_drop_index_by_name_args.prototype = {};\nThriftHiveMetastore_drop_index_by_name_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.index_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deleteData = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_index_by_name_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_index_by_name_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.index_name) {\n    output.writeFieldBegin('index_name', Thrift.Type.STRING, 3);\n    output.writeString(this.index_name);\n    output.writeFieldEnd();\n  }\n  if (this.deleteData) {\n    output.writeFieldBegin('deleteData', Thrift.Type.BOOL, 4);\n    output.writeBool(this.deleteData);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_index_by_name_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_drop_index_by_name_result.prototype = {};\nThriftHiveMetastore_drop_index_by_name_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_index_by_name_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_index_by_name_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_index_by_name_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.index_name = null;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.index_name !== undefined) {\n      this.index_name = args.index_name;\n    }\n  }\n};\nThriftHiveMetastore_get_index_by_name_args.prototype = {};\nThriftHiveMetastore_get_index_by_name_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.index_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_index_by_name_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_index_by_name_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.index_name) {\n    output.writeFieldBegin('index_name', Thrift.Type.STRING, 3);\n    output.writeString(this.index_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_index_by_name_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_index_by_name_result.prototype = {};\nThriftHiveMetastore_get_index_by_name_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.Index();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.NoSuchObjectException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_index_by_name_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_index_by_name_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_indexes_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.max_indexes = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.max_indexes !== undefined) {\n      this.max_indexes = args.max_indexes;\n    }\n  }\n};\nThriftHiveMetastore_get_indexes_args.prototype = {};\nThriftHiveMetastore_get_indexes_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I16) {\n        this.max_indexes = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_indexes_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_indexes_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.max_indexes) {\n    output.writeFieldBegin('max_indexes', Thrift.Type.I16, 3);\n    output.writeI16(this.max_indexes);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_indexes_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_indexes_result.prototype = {};\nThriftHiveMetastore_get_indexes_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size408 = 0;\n        var _rtmp3412;\n        this.success = [];\n        var _etype411 = 0;\n        _rtmp3412 = input.readListBegin();\n        _etype411 = _rtmp3412.etype;\n        _size408 = _rtmp3412.size;\n        for (var _i413 = 0; _i413 < _size408; ++_i413)\n        {\n          var elem414 = null;\n          elem414 = new ttypes.Index();\n          elem414.read(input);\n          this.success.push(elem414);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.NoSuchObjectException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_indexes_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_indexes_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter415 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter415))\n      {\n        iter415 = this.success[iter415];\n        iter415.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 2);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_index_names_args = function(args) {\n  this.db_name = null;\n  this.tbl_name = null;\n  this.max_indexes = -1;\n  if (args) {\n    if (args.db_name !== undefined) {\n      this.db_name = args.db_name;\n    }\n    if (args.tbl_name !== undefined) {\n      this.tbl_name = args.tbl_name;\n    }\n    if (args.max_indexes !== undefined) {\n      this.max_indexes = args.max_indexes;\n    }\n  }\n};\nThriftHiveMetastore_get_index_names_args.prototype = {};\nThriftHiveMetastore_get_index_names_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.db_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.tbl_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I16) {\n        this.max_indexes = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_index_names_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_index_names_args');\n  if (this.db_name) {\n    output.writeFieldBegin('db_name', Thrift.Type.STRING, 1);\n    output.writeString(this.db_name);\n    output.writeFieldEnd();\n  }\n  if (this.tbl_name) {\n    output.writeFieldBegin('tbl_name', Thrift.Type.STRING, 2);\n    output.writeString(this.tbl_name);\n    output.writeFieldEnd();\n  }\n  if (this.max_indexes) {\n    output.writeFieldBegin('max_indexes', Thrift.Type.I16, 3);\n    output.writeI16(this.max_indexes);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_index_names_result = function(args) {\n  this.success = null;\n  this.o2 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o2 !== undefined) {\n      this.o2 = args.o2;\n    }\n  }\n};\nThriftHiveMetastore_get_index_names_result.prototype = {};\nThriftHiveMetastore_get_index_names_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size416 = 0;\n        var _rtmp3420;\n        this.success = [];\n        var _etype419 = 0;\n        _rtmp3420 = input.readListBegin();\n        _etype419 = _rtmp3420.etype;\n        _size416 = _rtmp3420.size;\n        for (var _i421 = 0; _i421 < _size416; ++_i421)\n        {\n          var elem422 = null;\n          elem422 = input.readString();\n          this.success.push(elem422);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o2 = new ttypes.MetaException();\n        this.o2.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_index_names_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_index_names_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter423 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter423))\n      {\n        iter423 = this.success[iter423];\n        output.writeString(iter423);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o2) {\n    output.writeFieldBegin('o2', Thrift.Type.STRUCT, 1);\n    this.o2.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_role_args = function(args) {\n  this.role = null;\n  if (args) {\n    if (args.role !== undefined) {\n      this.role = args.role;\n    }\n  }\n};\nThriftHiveMetastore_create_role_args.prototype = {};\nThriftHiveMetastore_create_role_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.role = new ttypes.Role();\n        this.role.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_role_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_role_args');\n  if (this.role) {\n    output.writeFieldBegin('role', Thrift.Type.STRUCT, 1);\n    this.role.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_create_role_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_create_role_result.prototype = {};\nThriftHiveMetastore_create_role_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_create_role_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_create_role_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_role_args = function(args) {\n  this.role_name = null;\n  if (args) {\n    if (args.role_name !== undefined) {\n      this.role_name = args.role_name;\n    }\n  }\n};\nThriftHiveMetastore_drop_role_args.prototype = {};\nThriftHiveMetastore_drop_role_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.role_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_role_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_role_args');\n  if (this.role_name) {\n    output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);\n    output.writeString(this.role_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_drop_role_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_drop_role_result.prototype = {};\nThriftHiveMetastore_drop_role_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_drop_role_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_drop_role_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_role_names_args = function(args) {\n};\nThriftHiveMetastore_get_role_names_args.prototype = {};\nThriftHiveMetastore_get_role_names_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    input.skip(ftype);\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_role_names_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_role_names_args');\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_role_names_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_role_names_result.prototype = {};\nThriftHiveMetastore_get_role_names_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size424 = 0;\n        var _rtmp3428;\n        this.success = [];\n        var _etype427 = 0;\n        _rtmp3428 = input.readListBegin();\n        _etype427 = _rtmp3428.etype;\n        _size424 = _rtmp3428.size;\n        for (var _i429 = 0; _i429 < _size424; ++_i429)\n        {\n          var elem430 = null;\n          elem430 = input.readString();\n          this.success.push(elem430);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_role_names_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_role_names_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRING, this.success.length);\n    for (var iter431 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter431))\n      {\n        iter431 = this.success[iter431];\n        output.writeString(iter431);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_grant_role_args = function(args) {\n  this.role_name = null;\n  this.principal_name = null;\n  this.principal_type = null;\n  this.grantor = null;\n  this.grantorType = null;\n  this.grant_option = null;\n  if (args) {\n    if (args.role_name !== undefined) {\n      this.role_name = args.role_name;\n    }\n    if (args.principal_name !== undefined) {\n      this.principal_name = args.principal_name;\n    }\n    if (args.principal_type !== undefined) {\n      this.principal_type = args.principal_type;\n    }\n    if (args.grantor !== undefined) {\n      this.grantor = args.grantor;\n    }\n    if (args.grantorType !== undefined) {\n      this.grantorType = args.grantorType;\n    }\n    if (args.grant_option !== undefined) {\n      this.grant_option = args.grant_option;\n    }\n  }\n};\nThriftHiveMetastore_grant_role_args.prototype = {};\nThriftHiveMetastore_grant_role_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.role_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.principal_type = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.grantor = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.grantorType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.BOOL) {\n        this.grant_option = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_grant_role_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_grant_role_args');\n  if (this.role_name) {\n    output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);\n    output.writeString(this.role_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_name) {\n    output.writeFieldBegin('principal_name', Thrift.Type.STRING, 2);\n    output.writeString(this.principal_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_type) {\n    output.writeFieldBegin('principal_type', Thrift.Type.I32, 3);\n    output.writeI32(this.principal_type);\n    output.writeFieldEnd();\n  }\n  if (this.grantor) {\n    output.writeFieldBegin('grantor', Thrift.Type.STRING, 4);\n    output.writeString(this.grantor);\n    output.writeFieldEnd();\n  }\n  if (this.grantorType) {\n    output.writeFieldBegin('grantorType', Thrift.Type.I32, 5);\n    output.writeI32(this.grantorType);\n    output.writeFieldEnd();\n  }\n  if (this.grant_option) {\n    output.writeFieldBegin('grant_option', Thrift.Type.BOOL, 6);\n    output.writeBool(this.grant_option);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_grant_role_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_grant_role_result.prototype = {};\nThriftHiveMetastore_grant_role_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_grant_role_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_grant_role_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_revoke_role_args = function(args) {\n  this.role_name = null;\n  this.principal_name = null;\n  this.principal_type = null;\n  if (args) {\n    if (args.role_name !== undefined) {\n      this.role_name = args.role_name;\n    }\n    if (args.principal_name !== undefined) {\n      this.principal_name = args.principal_name;\n    }\n    if (args.principal_type !== undefined) {\n      this.principal_type = args.principal_type;\n    }\n  }\n};\nThriftHiveMetastore_revoke_role_args.prototype = {};\nThriftHiveMetastore_revoke_role_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.role_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.principal_type = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_revoke_role_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_revoke_role_args');\n  if (this.role_name) {\n    output.writeFieldBegin('role_name', Thrift.Type.STRING, 1);\n    output.writeString(this.role_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_name) {\n    output.writeFieldBegin('principal_name', Thrift.Type.STRING, 2);\n    output.writeString(this.principal_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_type) {\n    output.writeFieldBegin('principal_type', Thrift.Type.I32, 3);\n    output.writeI32(this.principal_type);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_revoke_role_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_revoke_role_result.prototype = {};\nThriftHiveMetastore_revoke_role_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_revoke_role_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_revoke_role_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_list_roles_args = function(args) {\n  this.principal_name = null;\n  this.principal_type = null;\n  if (args) {\n    if (args.principal_name !== undefined) {\n      this.principal_name = args.principal_name;\n    }\n    if (args.principal_type !== undefined) {\n      this.principal_type = args.principal_type;\n    }\n  }\n};\nThriftHiveMetastore_list_roles_args.prototype = {};\nThriftHiveMetastore_list_roles_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.principal_type = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_list_roles_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_list_roles_args');\n  if (this.principal_name) {\n    output.writeFieldBegin('principal_name', Thrift.Type.STRING, 1);\n    output.writeString(this.principal_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_type) {\n    output.writeFieldBegin('principal_type', Thrift.Type.I32, 2);\n    output.writeI32(this.principal_type);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_list_roles_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_list_roles_result.prototype = {};\nThriftHiveMetastore_list_roles_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size432 = 0;\n        var _rtmp3436;\n        this.success = [];\n        var _etype435 = 0;\n        _rtmp3436 = input.readListBegin();\n        _etype435 = _rtmp3436.etype;\n        _size432 = _rtmp3436.size;\n        for (var _i437 = 0; _i437 < _size432; ++_i437)\n        {\n          var elem438 = null;\n          elem438 = new ttypes.Role();\n          elem438.read(input);\n          this.success.push(elem438);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_list_roles_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_list_roles_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter439 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter439))\n      {\n        iter439 = this.success[iter439];\n        iter439.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_privilege_set_args = function(args) {\n  this.hiveObject = null;\n  this.user_name = null;\n  this.group_names = null;\n  if (args) {\n    if (args.hiveObject !== undefined) {\n      this.hiveObject = args.hiveObject;\n    }\n    if (args.user_name !== undefined) {\n      this.user_name = args.user_name;\n    }\n    if (args.group_names !== undefined) {\n      this.group_names = args.group_names;\n    }\n  }\n};\nThriftHiveMetastore_get_privilege_set_args.prototype = {};\nThriftHiveMetastore_get_privilege_set_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.hiveObject = new ttypes.HiveObjectRef();\n        this.hiveObject.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.user_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size440 = 0;\n        var _rtmp3444;\n        this.group_names = [];\n        var _etype443 = 0;\n        _rtmp3444 = input.readListBegin();\n        _etype443 = _rtmp3444.etype;\n        _size440 = _rtmp3444.size;\n        for (var _i445 = 0; _i445 < _size440; ++_i445)\n        {\n          var elem446 = null;\n          elem446 = input.readString();\n          this.group_names.push(elem446);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_privilege_set_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_privilege_set_args');\n  if (this.hiveObject) {\n    output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 1);\n    this.hiveObject.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.user_name) {\n    output.writeFieldBegin('user_name', Thrift.Type.STRING, 2);\n    output.writeString(this.user_name);\n    output.writeFieldEnd();\n  }\n  if (this.group_names) {\n    output.writeFieldBegin('group_names', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRING, this.group_names.length);\n    for (var iter447 in this.group_names)\n    {\n      if (this.group_names.hasOwnProperty(iter447))\n      {\n        iter447 = this.group_names[iter447];\n        output.writeString(iter447);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_privilege_set_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_privilege_set_result.prototype = {};\nThriftHiveMetastore_get_privilege_set_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.PrincipalPrivilegeSet();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_privilege_set_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_privilege_set_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_list_privileges_args = function(args) {\n  this.principal_name = null;\n  this.principal_type = null;\n  this.hiveObject = null;\n  if (args) {\n    if (args.principal_name !== undefined) {\n      this.principal_name = args.principal_name;\n    }\n    if (args.principal_type !== undefined) {\n      this.principal_type = args.principal_type;\n    }\n    if (args.hiveObject !== undefined) {\n      this.hiveObject = args.hiveObject;\n    }\n  }\n};\nThriftHiveMetastore_list_privileges_args.prototype = {};\nThriftHiveMetastore_list_privileges_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.principal_type = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.hiveObject = new ttypes.HiveObjectRef();\n        this.hiveObject.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_list_privileges_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_list_privileges_args');\n  if (this.principal_name) {\n    output.writeFieldBegin('principal_name', Thrift.Type.STRING, 1);\n    output.writeString(this.principal_name);\n    output.writeFieldEnd();\n  }\n  if (this.principal_type) {\n    output.writeFieldBegin('principal_type', Thrift.Type.I32, 2);\n    output.writeI32(this.principal_type);\n    output.writeFieldEnd();\n  }\n  if (this.hiveObject) {\n    output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 3);\n    this.hiveObject.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_list_privileges_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_list_privileges_result.prototype = {};\nThriftHiveMetastore_list_privileges_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.LIST) {\n        var _size448 = 0;\n        var _rtmp3452;\n        this.success = [];\n        var _etype451 = 0;\n        _rtmp3452 = input.readListBegin();\n        _etype451 = _rtmp3452.etype;\n        _size448 = _rtmp3452.size;\n        for (var _i453 = 0; _i453 < _size448; ++_i453)\n        {\n          var elem454 = null;\n          elem454 = new ttypes.HiveObjectPrivilege();\n          elem454.read(input);\n          this.success.push(elem454);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_list_privileges_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_list_privileges_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.LIST, 0);\n    output.writeListBegin(Thrift.Type.STRUCT, this.success.length);\n    for (var iter455 in this.success)\n    {\n      if (this.success.hasOwnProperty(iter455))\n      {\n        iter455 = this.success[iter455];\n        iter455.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_grant_privileges_args = function(args) {\n  this.privileges = null;\n  if (args) {\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nThriftHiveMetastore_grant_privileges_args.prototype = {};\nThriftHiveMetastore_grant_privileges_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.privileges = new ttypes.PrivilegeBag();\n        this.privileges.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_grant_privileges_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_grant_privileges_args');\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 1);\n    this.privileges.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_grant_privileges_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_grant_privileges_result.prototype = {};\nThriftHiveMetastore_grant_privileges_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_grant_privileges_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_grant_privileges_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_revoke_privileges_args = function(args) {\n  this.privileges = null;\n  if (args) {\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nThriftHiveMetastore_revoke_privileges_args.prototype = {};\nThriftHiveMetastore_revoke_privileges_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.privileges = new ttypes.PrivilegeBag();\n        this.privileges.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_revoke_privileges_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_revoke_privileges_args');\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 1);\n    this.privileges.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_revoke_privileges_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_revoke_privileges_result.prototype = {};\nThriftHiveMetastore_revoke_privileges_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.BOOL) {\n        this.success = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_revoke_privileges_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_revoke_privileges_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.BOOL, 0);\n    output.writeBool(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_delegation_token_args = function(args) {\n  this.renewer_kerberos_principal_name = null;\n  if (args) {\n    if (args.renewer_kerberos_principal_name !== undefined) {\n      this.renewer_kerberos_principal_name = args.renewer_kerberos_principal_name;\n    }\n  }\n};\nThriftHiveMetastore_get_delegation_token_args.prototype = {};\nThriftHiveMetastore_get_delegation_token_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.renewer_kerberos_principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_delegation_token_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_args');\n  if (this.renewer_kerberos_principal_name) {\n    output.writeFieldBegin('renewer_kerberos_principal_name', Thrift.Type.STRING, 1);\n    output.writeString(this.renewer_kerberos_principal_name);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_delegation_token_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_delegation_token_result.prototype = {};\nThriftHiveMetastore_get_delegation_token_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_delegation_token_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_delegation_token_with_signature_args = function(args) {\n  this.renewer_kerberos_principal_name = null;\n  this.token_signature = null;\n  if (args) {\n    if (args.renewer_kerberos_principal_name !== undefined) {\n      this.renewer_kerberos_principal_name = args.renewer_kerberos_principal_name;\n    }\n    if (args.token_signature !== undefined) {\n      this.token_signature = args.token_signature;\n    }\n  }\n};\nThriftHiveMetastore_get_delegation_token_with_signature_args.prototype = {};\nThriftHiveMetastore_get_delegation_token_with_signature_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.renewer_kerberos_principal_name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.token_signature = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_delegation_token_with_signature_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_args');\n  if (this.renewer_kerberos_principal_name) {\n    output.writeFieldBegin('renewer_kerberos_principal_name', Thrift.Type.STRING, 1);\n    output.writeString(this.renewer_kerberos_principal_name);\n    output.writeFieldEnd();\n  }\n  if (this.token_signature) {\n    output.writeFieldBegin('token_signature', Thrift.Type.STRING, 2);\n    output.writeString(this.token_signature);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_get_delegation_token_with_signature_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_get_delegation_token_with_signature_result.prototype = {};\nThriftHiveMetastore_get_delegation_token_with_signature_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRING) {\n        this.success = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_get_delegation_token_with_signature_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_get_delegation_token_with_signature_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.STRING, 0);\n    output.writeString(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_renew_delegation_token_args = function(args) {\n  this.token_str_form = null;\n  if (args) {\n    if (args.token_str_form !== undefined) {\n      this.token_str_form = args.token_str_form;\n    }\n  }\n};\nThriftHiveMetastore_renew_delegation_token_args.prototype = {};\nThriftHiveMetastore_renew_delegation_token_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.token_str_form = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_renew_delegation_token_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_renew_delegation_token_args');\n  if (this.token_str_form) {\n    output.writeFieldBegin('token_str_form', Thrift.Type.STRING, 1);\n    output.writeString(this.token_str_form);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_renew_delegation_token_result = function(args) {\n  this.success = null;\n  this.o1 = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_renew_delegation_token_result.prototype = {};\nThriftHiveMetastore_renew_delegation_token_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.I64) {\n        this.success = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_renew_delegation_token_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_renew_delegation_token_result');\n  if (this.success) {\n    output.writeFieldBegin('success', Thrift.Type.I64, 0);\n    output.writeI64(this.success);\n    output.writeFieldEnd();\n  }\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_cancel_delegation_token_args = function(args) {\n  this.token_str_form = null;\n  if (args) {\n    if (args.token_str_form !== undefined) {\n      this.token_str_form = args.token_str_form;\n    }\n  }\n};\nThriftHiveMetastore_cancel_delegation_token_args.prototype = {};\nThriftHiveMetastore_cancel_delegation_token_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.token_str_form = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_cancel_delegation_token_args.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_args');\n  if (this.token_str_form) {\n    output.writeFieldBegin('token_str_form', Thrift.Type.STRING, 1);\n    output.writeString(this.token_str_form);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastore_cancel_delegation_token_result = function(args) {\n  this.o1 = null;\n  if (args) {\n    if (args.o1 !== undefined) {\n      this.o1 = args.o1;\n    }\n  }\n};\nThriftHiveMetastore_cancel_delegation_token_result.prototype = {};\nThriftHiveMetastore_cancel_delegation_token_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.o1 = new ttypes.MetaException();\n        this.o1.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nThriftHiveMetastore_cancel_delegation_token_result.prototype.write = function(output) {\n  output.writeStructBegin('ThriftHiveMetastore_cancel_delegation_token_result');\n  if (this.o1) {\n    output.writeFieldBegin('o1', Thrift.Type.STRUCT, 1);\n    this.o1.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ThriftHiveMetastoreClient = exports.Client = function(output, pClass) {\n    this.output = output;\n    this.pClass = pClass;\n    this.seqid = 0;\n    this._reqs = {};\n};\nThrift.inherits(ThriftHiveMetastoreClient, FacebookServiceClient)\nThriftHiveMetastoreClient.prototype.create_database = function(database, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_create_database(database);\n};\n\nThriftHiveMetastoreClient.prototype.send_create_database = function(database) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('create_database', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_create_database_args();\n  args.database = database;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_create_database = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_create_database_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.get_database = function(name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_database(name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_database = function(name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_database', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_database_args();\n  args.name = name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_database = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_database_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_database failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.drop_database = function(name, deleteData, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_database(name, deleteData);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_database = function(name, deleteData) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_database', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_database_args();\n  args.name = name;\n  args.deleteData = deleteData;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_database = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_database_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.get_databases = function(pattern, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_databases(pattern);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_databases = function(pattern) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_databases', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_databases_args();\n  args.pattern = pattern;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_databases = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_databases_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_databases failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_all_databases = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_all_databases();\n};\n\nThriftHiveMetastoreClient.prototype.send_get_all_databases = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_all_databases', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_all_databases_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_all_databases = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_all_databases_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_all_databases failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.alter_database = function(dbname, db, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_alter_database(dbname, db);\n};\n\nThriftHiveMetastoreClient.prototype.send_alter_database = function(dbname, db) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('alter_database', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_alter_database_args();\n  args.dbname = dbname;\n  args.db = db;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_alter_database = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_alter_database_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.get_type = function(name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_type(name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_type = function(name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_type', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_type_args();\n  args.name = name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_type = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_type_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_type failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.create_type = function(type, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_create_type(type);\n};\n\nThriftHiveMetastoreClient.prototype.send_create_type = function(type) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('create_type', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_create_type_args();\n  args.type = type;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_create_type = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_create_type_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('create_type failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.drop_type = function(type, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_type(type);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_type = function(type) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_type', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_type_args();\n  args.type = type;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_type = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_type_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('drop_type failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_type_all = function(name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_type_all(name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_type_all = function(name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_type_all', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_type_all_args();\n  args.name = name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_type_all = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_type_all_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_type_all failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_fields = function(db_name, table_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_fields(db_name, table_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_fields = function(db_name, table_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_fields', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_fields_args();\n  args.db_name = db_name;\n  args.table_name = table_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_fields = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_fields_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_fields failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_schema = function(db_name, table_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_schema(db_name, table_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_schema = function(db_name, table_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_schema', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_schema_args();\n  args.db_name = db_name;\n  args.table_name = table_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_schema = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_schema_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_schema failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.create_table = function(tbl, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_create_table(tbl);\n};\n\nThriftHiveMetastoreClient.prototype.send_create_table = function(tbl) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('create_table', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_create_table_args();\n  args.tbl = tbl;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_create_table = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_create_table_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.o4) {\n    return callback(result.o4);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.drop_table = function(dbname, name, deleteData, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_table(dbname, name, deleteData);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_table = function(dbname, name, deleteData) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_table', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_table_args();\n  args.dbname = dbname;\n  args.name = name;\n  args.deleteData = deleteData;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_table = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_table_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.get_tables = function(db_name, pattern, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_tables(db_name, pattern);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_tables = function(db_name, pattern) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_tables', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_tables_args();\n  args.db_name = db_name;\n  args.pattern = pattern;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_tables = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_tables_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_tables failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_all_tables = function(db_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_all_tables(db_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_all_tables = function(db_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_all_tables', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_all_tables_args();\n  args.db_name = db_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_all_tables = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_all_tables_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_all_tables failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_table = function(dbname, tbl_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_table(dbname, tbl_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_table = function(dbname, tbl_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_table', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_table_args();\n  args.dbname = dbname;\n  args.tbl_name = tbl_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_table = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_table_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_table failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.alter_table = function(dbname, tbl_name, new_tbl, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_alter_table(dbname, tbl_name, new_tbl);\n};\n\nThriftHiveMetastoreClient.prototype.send_alter_table = function(dbname, tbl_name, new_tbl) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('alter_table', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_alter_table_args();\n  args.dbname = dbname;\n  args.tbl_name = tbl_name;\n  args.new_tbl = new_tbl;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_alter_table = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_alter_table_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.add_partition = function(new_part, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_add_partition(new_part);\n};\n\nThriftHiveMetastoreClient.prototype.send_add_partition = function(new_part) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('add_partition', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_add_partition_args();\n  args.new_part = new_part;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_add_partition = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_add_partition_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('add_partition failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.append_partition = function(db_name, tbl_name, part_vals, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_append_partition(db_name, tbl_name, part_vals);\n};\n\nThriftHiveMetastoreClient.prototype.send_append_partition = function(db_name, tbl_name, part_vals) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('append_partition', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_append_partition_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_append_partition = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_append_partition_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('append_partition failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.append_partition_by_name = function(db_name, tbl_name, part_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_append_partition_by_name(db_name, tbl_name, part_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_append_partition_by_name = function(db_name, tbl_name, part_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('append_partition_by_name', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_append_partition_by_name_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_name = part_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_append_partition_by_name = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_append_partition_by_name_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('append_partition_by_name failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.drop_partition = function(db_name, tbl_name, part_vals, deleteData, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_partition(db_name, tbl_name, part_vals, deleteData);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_partition = function(db_name, tbl_name, part_vals, deleteData) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_partition', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_partition_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.deleteData = deleteData;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_partition = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_partition_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('drop_partition failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.drop_partition_by_name = function(db_name, tbl_name, part_name, deleteData, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_partition_by_name(db_name, tbl_name, part_name, deleteData);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_partition_by_name = function(db_name, tbl_name, part_name, deleteData) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_partition_by_name', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_partition_by_name_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_name = part_name;\n  args.deleteData = deleteData;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_partition_by_name = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_partition_by_name_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('drop_partition_by_name failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partition = function(db_name, tbl_name, part_vals, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partition(db_name, tbl_name, part_vals);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partition = function(db_name, tbl_name, part_vals) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partition', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partition_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partition = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partition_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partition failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partition_with_auth = function(db_name, tbl_name, part_vals, user_name, group_names, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partition_with_auth = function(db_name, tbl_name, part_vals, user_name, group_names) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partition_with_auth', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partition_with_auth_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.user_name = user_name;\n  args.group_names = group_names;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partition_with_auth = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partition_with_auth_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partition_with_auth failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partition_by_name = function(db_name, tbl_name, part_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partition_by_name(db_name, tbl_name, part_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partition_by_name = function(db_name, tbl_name, part_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partition_by_name', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partition_by_name_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_name = part_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partition_by_name = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partition_by_name_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partition_by_name failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partitions = function(db_name, tbl_name, max_parts, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partitions(db_name, tbl_name, max_parts);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partitions = function(db_name, tbl_name, max_parts) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partitions', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partitions_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.max_parts = max_parts;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partitions = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partitions_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partitions failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partitions_with_auth = function(db_name, tbl_name, max_parts, user_name, group_names, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partitions_with_auth = function(db_name, tbl_name, max_parts, user_name, group_names) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partitions_with_auth', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partitions_with_auth_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.max_parts = max_parts;\n  args.user_name = user_name;\n  args.group_names = group_names;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partitions_with_auth = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partitions_with_auth_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partitions_with_auth failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partition_names = function(db_name, tbl_name, max_parts, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partition_names(db_name, tbl_name, max_parts);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partition_names = function(db_name, tbl_name, max_parts) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partition_names', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partition_names_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.max_parts = max_parts;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partition_names = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partition_names_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partition_names failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partitions_ps = function(db_name, tbl_name, part_vals, max_parts, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partitions_ps(db_name, tbl_name, part_vals, max_parts);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partitions_ps = function(db_name, tbl_name, part_vals, max_parts) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partitions_ps', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partitions_ps_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.max_parts = max_parts;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partitions_ps = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partitions_ps_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partitions_ps failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partitions_ps_with_auth = function(db_name, tbl_name, part_vals, max_parts, user_name, group_names, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partitions_ps_with_auth = function(db_name, tbl_name, part_vals, max_parts, user_name, group_names) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partitions_ps_with_auth', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partitions_ps_with_auth_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.max_parts = max_parts;\n  args.user_name = user_name;\n  args.group_names = group_names;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partitions_ps_with_auth = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partitions_ps_with_auth_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partitions_ps_with_auth failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partition_names_ps = function(db_name, tbl_name, part_vals, max_parts, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partition_names_ps(db_name, tbl_name, part_vals, max_parts);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partition_names_ps = function(db_name, tbl_name, part_vals, max_parts) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partition_names_ps', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partition_names_ps_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.part_vals = part_vals;\n  args.max_parts = max_parts;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partition_names_ps = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partition_names_ps_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partition_names_ps failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_partitions_by_filter = function(db_name, tbl_name, filter, max_parts, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_partitions_by_filter(db_name, tbl_name, filter, max_parts);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_partitions_by_filter = function(db_name, tbl_name, filter, max_parts) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_partitions_by_filter', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_partitions_by_filter_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.filter = filter;\n  args.max_parts = max_parts;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_partitions_by_filter = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_partitions_by_filter_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_partitions_by_filter failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.alter_partition = function(db_name, tbl_name, new_part, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_alter_partition(db_name, tbl_name, new_part);\n};\n\nThriftHiveMetastoreClient.prototype.send_alter_partition = function(db_name, tbl_name, new_part) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('alter_partition', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_alter_partition_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.new_part = new_part;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_alter_partition = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_alter_partition_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.get_config_value = function(name, defaultValue, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_config_value(name, defaultValue);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_config_value = function(name, defaultValue) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_config_value', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_config_value_args();\n  args.name = name;\n  args.defaultValue = defaultValue;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_config_value = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_config_value_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_config_value failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.partition_name_to_vals = function(part_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_partition_name_to_vals(part_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_partition_name_to_vals = function(part_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('partition_name_to_vals', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_partition_name_to_vals_args();\n  args.part_name = part_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_partition_name_to_vals = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_partition_name_to_vals_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('partition_name_to_vals failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.partition_name_to_spec = function(part_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_partition_name_to_spec(part_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_partition_name_to_spec = function(part_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('partition_name_to_spec', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_partition_name_to_spec_args();\n  args.part_name = part_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_partition_name_to_spec = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_partition_name_to_spec_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('partition_name_to_spec failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.add_index = function(new_index, index_table, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_add_index(new_index, index_table);\n};\n\nThriftHiveMetastoreClient.prototype.send_add_index = function(new_index, index_table) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('add_index', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_add_index_args();\n  args.new_index = new_index;\n  args.index_table = index_table;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_add_index = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_add_index_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.o3) {\n    return callback(result.o3);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('add_index failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.alter_index = function(dbname, base_tbl_name, idx_name, new_idx, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_alter_index(dbname, base_tbl_name, idx_name, new_idx);\n};\n\nThriftHiveMetastoreClient.prototype.send_alter_index = function(dbname, base_tbl_name, idx_name, new_idx) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('alter_index', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_alter_index_args();\n  args.dbname = dbname;\n  args.base_tbl_name = base_tbl_name;\n  args.idx_name = idx_name;\n  args.new_idx = new_idx;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_alter_index = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_alter_index_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  callback(null)\n};\nThriftHiveMetastoreClient.prototype.drop_index_by_name = function(db_name, tbl_name, index_name, deleteData, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_index_by_name(db_name, tbl_name, index_name, deleteData);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_index_by_name = function(db_name, tbl_name, index_name, deleteData) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_index_by_name', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_index_by_name_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.index_name = index_name;\n  args.deleteData = deleteData;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_index_by_name = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_index_by_name_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('drop_index_by_name failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_index_by_name = function(db_name, tbl_name, index_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_index_by_name(db_name, tbl_name, index_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_index_by_name = function(db_name, tbl_name, index_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_index_by_name', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_index_by_name_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.index_name = index_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_index_by_name = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_index_by_name_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_index_by_name failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_indexes = function(db_name, tbl_name, max_indexes, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_indexes(db_name, tbl_name, max_indexes);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_indexes = function(db_name, tbl_name, max_indexes) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_indexes', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_indexes_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.max_indexes = max_indexes;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_indexes = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_indexes_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_indexes failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_index_names = function(db_name, tbl_name, max_indexes, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_index_names(db_name, tbl_name, max_indexes);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_index_names = function(db_name, tbl_name, max_indexes) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_index_names', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_index_names_args();\n  args.db_name = db_name;\n  args.tbl_name = tbl_name;\n  args.max_indexes = max_indexes;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_index_names = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_index_names_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o2) {\n    return callback(result.o2);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_index_names failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.create_role = function(role, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_create_role(role);\n};\n\nThriftHiveMetastoreClient.prototype.send_create_role = function(role) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('create_role', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_create_role_args();\n  args.role = role;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_create_role = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_create_role_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('create_role failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.drop_role = function(role_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_drop_role(role_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_drop_role = function(role_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('drop_role', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_drop_role_args();\n  args.role_name = role_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_drop_role = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_drop_role_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('drop_role failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_role_names = function(callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_role_names();\n};\n\nThriftHiveMetastoreClient.prototype.send_get_role_names = function() {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_role_names', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_role_names_args();\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_role_names = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_role_names_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_role_names failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.grant_role = function(role_name, principal_name, principal_type, grantor, grantorType, grant_option, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option);\n};\n\nThriftHiveMetastoreClient.prototype.send_grant_role = function(role_name, principal_name, principal_type, grantor, grantorType, grant_option) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('grant_role', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_grant_role_args();\n  args.role_name = role_name;\n  args.principal_name = principal_name;\n  args.principal_type = principal_type;\n  args.grantor = grantor;\n  args.grantorType = grantorType;\n  args.grant_option = grant_option;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_grant_role = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_grant_role_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('grant_role failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.revoke_role = function(role_name, principal_name, principal_type, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_revoke_role(role_name, principal_name, principal_type);\n};\n\nThriftHiveMetastoreClient.prototype.send_revoke_role = function(role_name, principal_name, principal_type) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('revoke_role', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_revoke_role_args();\n  args.role_name = role_name;\n  args.principal_name = principal_name;\n  args.principal_type = principal_type;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_revoke_role = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_revoke_role_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('revoke_role failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.list_roles = function(principal_name, principal_type, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_list_roles(principal_name, principal_type);\n};\n\nThriftHiveMetastoreClient.prototype.send_list_roles = function(principal_name, principal_type) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('list_roles', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_list_roles_args();\n  args.principal_name = principal_name;\n  args.principal_type = principal_type;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_list_roles = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_list_roles_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('list_roles failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_privilege_set = function(hiveObject, user_name, group_names, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_privilege_set(hiveObject, user_name, group_names);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_privilege_set = function(hiveObject, user_name, group_names) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_privilege_set', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_privilege_set_args();\n  args.hiveObject = hiveObject;\n  args.user_name = user_name;\n  args.group_names = group_names;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_privilege_set = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_privilege_set_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_privilege_set failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.list_privileges = function(principal_name, principal_type, hiveObject, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_list_privileges(principal_name, principal_type, hiveObject);\n};\n\nThriftHiveMetastoreClient.prototype.send_list_privileges = function(principal_name, principal_type, hiveObject) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('list_privileges', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_list_privileges_args();\n  args.principal_name = principal_name;\n  args.principal_type = principal_type;\n  args.hiveObject = hiveObject;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_list_privileges = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_list_privileges_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('list_privileges failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.grant_privileges = function(privileges, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_grant_privileges(privileges);\n};\n\nThriftHiveMetastoreClient.prototype.send_grant_privileges = function(privileges) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('grant_privileges', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_grant_privileges_args();\n  args.privileges = privileges;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_grant_privileges = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_grant_privileges_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('grant_privileges failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.revoke_privileges = function(privileges, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_revoke_privileges(privileges);\n};\n\nThriftHiveMetastoreClient.prototype.send_revoke_privileges = function(privileges) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('revoke_privileges', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_revoke_privileges_args();\n  args.privileges = privileges;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_revoke_privileges = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_revoke_privileges_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('revoke_privileges failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_delegation_token = function(renewer_kerberos_principal_name, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_delegation_token(renewer_kerberos_principal_name);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_delegation_token = function(renewer_kerberos_principal_name) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_delegation_token', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_delegation_token_args();\n  args.renewer_kerberos_principal_name = renewer_kerberos_principal_name;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_delegation_token = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_delegation_token_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_delegation_token failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.get_delegation_token_with_signature = function(renewer_kerberos_principal_name, token_signature, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_get_delegation_token_with_signature(renewer_kerberos_principal_name, token_signature);\n};\n\nThriftHiveMetastoreClient.prototype.send_get_delegation_token_with_signature = function(renewer_kerberos_principal_name, token_signature) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('get_delegation_token_with_signature', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_get_delegation_token_with_signature_args();\n  args.renewer_kerberos_principal_name = renewer_kerberos_principal_name;\n  args.token_signature = token_signature;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_get_delegation_token_with_signature = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_get_delegation_token_with_signature_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('get_delegation_token_with_signature failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.renew_delegation_token = function(token_str_form, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_renew_delegation_token(token_str_form);\n};\n\nThriftHiveMetastoreClient.prototype.send_renew_delegation_token = function(token_str_form) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('renew_delegation_token', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_renew_delegation_token_args();\n  args.token_str_form = token_str_form;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_renew_delegation_token = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_renew_delegation_token_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('renew_delegation_token failed: unknown result');\n};\nThriftHiveMetastoreClient.prototype.cancel_delegation_token = function(token_str_form, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_cancel_delegation_token(token_str_form);\n};\n\nThriftHiveMetastoreClient.prototype.send_cancel_delegation_token = function(token_str_form) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('cancel_delegation_token', Thrift.MessageType.CALL, this.seqid);\n  var args = new ThriftHiveMetastore_cancel_delegation_token_args();\n  args.token_str_form = token_str_form;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nThriftHiveMetastoreClient.prototype.recv_cancel_delegation_token = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new ThriftHiveMetastore_cancel_delegation_token_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.o1) {\n    return callback(result.o1);\n  }\n  callback(null)\n};\nvar ThriftHiveMetastoreProcessor = exports.Processor = function(handler) {\n  this._handler = handler\n}\nThrift.inherits(ThriftHiveMetastoreProcessor, FacebookServiceProcessor)\nThriftHiveMetastoreProcessor.prototype.process = function(input, output) {\n  var r = input.readMessageBegin();\n  if (this['process_' + r.fname]) {\n    return this['process_' + r.fname].call(this, r.rseqid, input, output);\n  } else {\n    input.skip(Thrift.Type.STRUCT);\n    input.readMessageEnd();\n    var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);\n    output.writeMessageBegin(r.fname, Thrift.MessageType.Exception, r.rseqid);\n    x.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  }\n}\n\nThriftHiveMetastoreProcessor.prototype.process_create_database = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_create_database_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_create_database_result();\n  this._handler.create_database(args.database, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"create_database\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_database = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_database_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_database_result();\n  this._handler.get_database(args.name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_database\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_database = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_database_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_database_result();\n  this._handler.drop_database(args.name, args.deleteData, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_database\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_databases = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_databases_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_databases_result();\n  this._handler.get_databases(args.pattern, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_databases\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_all_databases = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_all_databases_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_all_databases_result();\n  this._handler.get_all_databases(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_all_databases\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_alter_database = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_alter_database_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_alter_database_result();\n  this._handler.alter_database(args.dbname, args.db, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"alter_database\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_type = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_type_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_type_result();\n  this._handler.get_type(args.name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_type\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_create_type = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_create_type_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_create_type_result();\n  this._handler.create_type(args.type, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"create_type\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_type = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_type_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_type_result();\n  this._handler.drop_type(args.type, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_type\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_type_all = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_type_all_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_type_all_result();\n  this._handler.get_type_all(args.name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_type_all\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_fields = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_fields_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_fields_result();\n  this._handler.get_fields(args.db_name, args.table_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_fields\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_schema = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_schema_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_schema_result();\n  this._handler.get_schema(args.db_name, args.table_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_schema\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_create_table = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_create_table_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_create_table_result();\n  this._handler.create_table(args.tbl, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"create_table\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_table = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_table_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_table_result();\n  this._handler.drop_table(args.dbname, args.name, args.deleteData, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_table\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_tables = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_tables_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_tables_result();\n  this._handler.get_tables(args.db_name, args.pattern, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_tables\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_all_tables = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_all_tables_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_all_tables_result();\n  this._handler.get_all_tables(args.db_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_all_tables\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_table = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_table_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_table_result();\n  this._handler.get_table(args.dbname, args.tbl_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_table\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_alter_table = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_alter_table_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_alter_table_result();\n  this._handler.alter_table(args.dbname, args.tbl_name, args.new_tbl, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"alter_table\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_add_partition = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_add_partition_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_add_partition_result();\n  this._handler.add_partition(args.new_part, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"add_partition\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_append_partition = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_append_partition_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_append_partition_result();\n  this._handler.append_partition(args.db_name, args.tbl_name, args.part_vals, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"append_partition\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_append_partition_by_name = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_append_partition_by_name_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_append_partition_by_name_result();\n  this._handler.append_partition_by_name(args.db_name, args.tbl_name, args.part_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"append_partition_by_name\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_partition = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_partition_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_partition_result();\n  this._handler.drop_partition(args.db_name, args.tbl_name, args.part_vals, args.deleteData, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_partition\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_partition_by_name = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_partition_by_name_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_partition_by_name_result();\n  this._handler.drop_partition_by_name(args.db_name, args.tbl_name, args.part_name, args.deleteData, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_partition_by_name\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partition = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partition_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partition_result();\n  this._handler.get_partition(args.db_name, args.tbl_name, args.part_vals, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partition\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partition_with_auth = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partition_with_auth_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partition_with_auth_result();\n  this._handler.get_partition_with_auth(args.db_name, args.tbl_name, args.part_vals, args.user_name, args.group_names, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partition_with_auth\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partition_by_name = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partition_by_name_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partition_by_name_result();\n  this._handler.get_partition_by_name(args.db_name, args.tbl_name, args.part_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partition_by_name\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partitions = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partitions_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partitions_result();\n  this._handler.get_partitions(args.db_name, args.tbl_name, args.max_parts, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partitions\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partitions_with_auth = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partitions_with_auth_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partitions_with_auth_result();\n  this._handler.get_partitions_with_auth(args.db_name, args.tbl_name, args.max_parts, args.user_name, args.group_names, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partitions_with_auth\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partition_names = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partition_names_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partition_names_result();\n  this._handler.get_partition_names(args.db_name, args.tbl_name, args.max_parts, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partition_names\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partitions_ps = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partitions_ps_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partitions_ps_result();\n  this._handler.get_partitions_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partitions_ps\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partitions_ps_with_auth = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partitions_ps_with_auth_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partitions_ps_with_auth_result();\n  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) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partitions_ps_with_auth\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partition_names_ps = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partition_names_ps_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partition_names_ps_result();\n  this._handler.get_partition_names_ps(args.db_name, args.tbl_name, args.part_vals, args.max_parts, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partition_names_ps\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_partitions_by_filter = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_partitions_by_filter_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_partitions_by_filter_result();\n  this._handler.get_partitions_by_filter(args.db_name, args.tbl_name, args.filter, args.max_parts, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_partitions_by_filter\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_alter_partition = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_alter_partition_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_alter_partition_result();\n  this._handler.alter_partition(args.db_name, args.tbl_name, args.new_part, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"alter_partition\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_config_value = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_config_value_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_config_value_result();\n  this._handler.get_config_value(args.name, args.defaultValue, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_config_value\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_partition_name_to_vals = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_partition_name_to_vals_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_partition_name_to_vals_result();\n  this._handler.partition_name_to_vals(args.part_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"partition_name_to_vals\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_partition_name_to_spec = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_partition_name_to_spec_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_partition_name_to_spec_result();\n  this._handler.partition_name_to_spec(args.part_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"partition_name_to_spec\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_add_index = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_add_index_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_add_index_result();\n  this._handler.add_index(args.new_index, args.index_table, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"add_index\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_alter_index = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_alter_index_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_alter_index_result();\n  this._handler.alter_index(args.dbname, args.base_tbl_name, args.idx_name, args.new_idx, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"alter_index\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_index_by_name = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_index_by_name_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_index_by_name_result();\n  this._handler.drop_index_by_name(args.db_name, args.tbl_name, args.index_name, args.deleteData, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_index_by_name\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_index_by_name = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_index_by_name_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_index_by_name_result();\n  this._handler.get_index_by_name(args.db_name, args.tbl_name, args.index_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_index_by_name\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_indexes = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_indexes_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_indexes_result();\n  this._handler.get_indexes(args.db_name, args.tbl_name, args.max_indexes, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_indexes\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_index_names = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_index_names_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_index_names_result();\n  this._handler.get_index_names(args.db_name, args.tbl_name, args.max_indexes, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_index_names\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_create_role = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_create_role_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_create_role_result();\n  this._handler.create_role(args.role, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"create_role\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_drop_role = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_drop_role_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_drop_role_result();\n  this._handler.drop_role(args.role_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"drop_role\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_role_names = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_role_names_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_role_names_result();\n  this._handler.get_role_names(function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_role_names\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_grant_role = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_grant_role_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_grant_role_result();\n  this._handler.grant_role(args.role_name, args.principal_name, args.principal_type, args.grantor, args.grantorType, args.grant_option, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"grant_role\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_revoke_role = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_revoke_role_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_revoke_role_result();\n  this._handler.revoke_role(args.role_name, args.principal_name, args.principal_type, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"revoke_role\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_list_roles = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_list_roles_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_list_roles_result();\n  this._handler.list_roles(args.principal_name, args.principal_type, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"list_roles\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_privilege_set = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_privilege_set_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_privilege_set_result();\n  this._handler.get_privilege_set(args.hiveObject, args.user_name, args.group_names, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_privilege_set\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_list_privileges = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_list_privileges_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_list_privileges_result();\n  this._handler.list_privileges(args.principal_name, args.principal_type, args.hiveObject, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"list_privileges\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_grant_privileges = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_grant_privileges_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_grant_privileges_result();\n  this._handler.grant_privileges(args.privileges, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"grant_privileges\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_revoke_privileges = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_revoke_privileges_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_revoke_privileges_result();\n  this._handler.revoke_privileges(args.privileges, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"revoke_privileges\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_delegation_token = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_delegation_token_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_delegation_token_result();\n  this._handler.get_delegation_token(args.renewer_kerberos_principal_name, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_delegation_token\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_get_delegation_token_with_signature = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_get_delegation_token_with_signature_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_get_delegation_token_with_signature_result();\n  this._handler.get_delegation_token_with_signature(args.renewer_kerberos_principal_name, args.token_signature, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"get_delegation_token_with_signature\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_renew_delegation_token = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_renew_delegation_token_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_renew_delegation_token_result();\n  this._handler.renew_delegation_token(args.token_str_form, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"renew_delegation_token\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nThriftHiveMetastoreProcessor.prototype.process_cancel_delegation_token = function(seqid, input, output) {\n  var args = new ThriftHiveMetastore_cancel_delegation_token_args();\n  args.read(input);\n  input.readMessageEnd();\n  var result = new ThriftHiveMetastore_cancel_delegation_token_result();\n  this._handler.cancel_delegation_token(args.token_str_form, function (success) {\n    result.success = success;\n    output.writeMessageBegin(\"cancel_delegation_token\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/fb303_types.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar ttypes = module.exports = {};\nttypes.fb_status = {\n'DEAD' : 0,\n'STARTING' : 1,\n'ALIVE' : 2,\n'STOPPING' : 3,\n'STOPPED' : 4,\n'WARNING' : 5\n};\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/hive_metastore_types.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar ttypes = module.exports = {};\nttypes.HiveObjectType = {\n'GLOBAL' : 1,\n'DATABASE' : 2,\n'TABLE' : 3,\n'PARTITION' : 4,\n'COLUMN' : 5\n};\nttypes.PrincipalType = {\n'USER' : 1,\n'ROLE' : 2,\n'GROUP' : 3\n};\nvar Version = module.exports.Version = function(args) {\n  this.version = null;\n  this.comments = null;\n  if (args) {\n    if (args.version !== undefined) {\n      this.version = args.version;\n    }\n    if (args.comments !== undefined) {\n      this.comments = args.comments;\n    }\n  }\n};\nVersion.prototype = {};\nVersion.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.version = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.comments = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nVersion.prototype.write = function(output) {\n  output.writeStructBegin('Version');\n  if (this.version) {\n    output.writeFieldBegin('version', Thrift.Type.STRING, 1);\n    output.writeString(this.version);\n    output.writeFieldEnd();\n  }\n  if (this.comments) {\n    output.writeFieldBegin('comments', Thrift.Type.STRING, 2);\n    output.writeString(this.comments);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar FieldSchema = module.exports.FieldSchema = function(args) {\n  this.name = null;\n  this.type = null;\n  this.comment = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.type !== undefined) {\n      this.type = args.type;\n    }\n    if (args.comment !== undefined) {\n      this.comment = args.comment;\n    }\n  }\n};\nFieldSchema.prototype = {};\nFieldSchema.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.type = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.comment = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nFieldSchema.prototype.write = function(output) {\n  output.writeStructBegin('FieldSchema');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.type) {\n    output.writeFieldBegin('type', Thrift.Type.STRING, 2);\n    output.writeString(this.type);\n    output.writeFieldEnd();\n  }\n  if (this.comment) {\n    output.writeFieldBegin('comment', Thrift.Type.STRING, 3);\n    output.writeString(this.comment);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Type = module.exports.Type = function(args) {\n  this.name = null;\n  this.type1 = null;\n  this.type2 = null;\n  this.fields = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.type1 !== undefined) {\n      this.type1 = args.type1;\n    }\n    if (args.type2 !== undefined) {\n      this.type2 = args.type2;\n    }\n    if (args.fields !== undefined) {\n      this.fields = args.fields;\n    }\n  }\n};\nType.prototype = {};\nType.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.type1 = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.type2 = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.LIST) {\n        var _size0 = 0;\n        var _rtmp34;\n        this.fields = [];\n        var _etype3 = 0;\n        _rtmp34 = input.readListBegin();\n        _etype3 = _rtmp34.etype;\n        _size0 = _rtmp34.size;\n        for (var _i5 = 0; _i5 < _size0; ++_i5)\n        {\n          var elem6 = null;\n          elem6 = new ttypes.FieldSchema();\n          elem6.read(input);\n          this.fields.push(elem6);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nType.prototype.write = function(output) {\n  output.writeStructBegin('Type');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.type1) {\n    output.writeFieldBegin('type1', Thrift.Type.STRING, 2);\n    output.writeString(this.type1);\n    output.writeFieldEnd();\n  }\n  if (this.type2) {\n    output.writeFieldBegin('type2', Thrift.Type.STRING, 3);\n    output.writeString(this.type2);\n    output.writeFieldEnd();\n  }\n  if (this.fields) {\n    output.writeFieldBegin('fields', Thrift.Type.LIST, 4);\n    output.writeListBegin(Thrift.Type.STRUCT, this.fields.length);\n    for (var iter7 in this.fields)\n    {\n      if (this.fields.hasOwnProperty(iter7))\n      {\n        iter7 = this.fields[iter7];\n        iter7.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar HiveObjectRef = module.exports.HiveObjectRef = function(args) {\n  this.objectType = null;\n  this.dbName = null;\n  this.objectName = null;\n  this.partValues = null;\n  this.columnName = null;\n  if (args) {\n    if (args.objectType !== undefined) {\n      this.objectType = args.objectType;\n    }\n    if (args.dbName !== undefined) {\n      this.dbName = args.dbName;\n    }\n    if (args.objectName !== undefined) {\n      this.objectName = args.objectName;\n    }\n    if (args.partValues !== undefined) {\n      this.partValues = args.partValues;\n    }\n    if (args.columnName !== undefined) {\n      this.columnName = args.columnName;\n    }\n  }\n};\nHiveObjectRef.prototype = {};\nHiveObjectRef.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.objectType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.objectName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.LIST) {\n        var _size8 = 0;\n        var _rtmp312;\n        this.partValues = [];\n        var _etype11 = 0;\n        _rtmp312 = input.readListBegin();\n        _etype11 = _rtmp312.etype;\n        _size8 = _rtmp312.size;\n        for (var _i13 = 0; _i13 < _size8; ++_i13)\n        {\n          var elem14 = null;\n          elem14 = input.readString();\n          this.partValues.push(elem14);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRING) {\n        this.columnName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nHiveObjectRef.prototype.write = function(output) {\n  output.writeStructBegin('HiveObjectRef');\n  if (this.objectType) {\n    output.writeFieldBegin('objectType', Thrift.Type.I32, 1);\n    output.writeI32(this.objectType);\n    output.writeFieldEnd();\n  }\n  if (this.dbName) {\n    output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);\n    output.writeString(this.dbName);\n    output.writeFieldEnd();\n  }\n  if (this.objectName) {\n    output.writeFieldBegin('objectName', Thrift.Type.STRING, 3);\n    output.writeString(this.objectName);\n    output.writeFieldEnd();\n  }\n  if (this.partValues) {\n    output.writeFieldBegin('partValues', Thrift.Type.LIST, 4);\n    output.writeListBegin(Thrift.Type.STRING, this.partValues.length);\n    for (var iter15 in this.partValues)\n    {\n      if (this.partValues.hasOwnProperty(iter15))\n      {\n        iter15 = this.partValues[iter15];\n        output.writeString(iter15);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.columnName) {\n    output.writeFieldBegin('columnName', Thrift.Type.STRING, 5);\n    output.writeString(this.columnName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar PrivilegeGrantInfo = module.exports.PrivilegeGrantInfo = function(args) {\n  this.privilege = null;\n  this.createTime = null;\n  this.grantor = null;\n  this.grantorType = null;\n  this.grantOption = null;\n  if (args) {\n    if (args.privilege !== undefined) {\n      this.privilege = args.privilege;\n    }\n    if (args.createTime !== undefined) {\n      this.createTime = args.createTime;\n    }\n    if (args.grantor !== undefined) {\n      this.grantor = args.grantor;\n    }\n    if (args.grantorType !== undefined) {\n      this.grantorType = args.grantorType;\n    }\n    if (args.grantOption !== undefined) {\n      this.grantOption = args.grantOption;\n    }\n  }\n};\nPrivilegeGrantInfo.prototype = {};\nPrivilegeGrantInfo.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.privilege = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.createTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.grantor = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.grantorType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.BOOL) {\n        this.grantOption = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nPrivilegeGrantInfo.prototype.write = function(output) {\n  output.writeStructBegin('PrivilegeGrantInfo');\n  if (this.privilege) {\n    output.writeFieldBegin('privilege', Thrift.Type.STRING, 1);\n    output.writeString(this.privilege);\n    output.writeFieldEnd();\n  }\n  if (this.createTime) {\n    output.writeFieldBegin('createTime', Thrift.Type.I32, 2);\n    output.writeI32(this.createTime);\n    output.writeFieldEnd();\n  }\n  if (this.grantor) {\n    output.writeFieldBegin('grantor', Thrift.Type.STRING, 3);\n    output.writeString(this.grantor);\n    output.writeFieldEnd();\n  }\n  if (this.grantorType) {\n    output.writeFieldBegin('grantorType', Thrift.Type.I32, 4);\n    output.writeI32(this.grantorType);\n    output.writeFieldEnd();\n  }\n  if (this.grantOption) {\n    output.writeFieldBegin('grantOption', Thrift.Type.BOOL, 5);\n    output.writeBool(this.grantOption);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar HiveObjectPrivilege = module.exports.HiveObjectPrivilege = function(args) {\n  this.hiveObject = null;\n  this.principalName = null;\n  this.principalType = null;\n  this.grantInfo = null;\n  if (args) {\n    if (args.hiveObject !== undefined) {\n      this.hiveObject = args.hiveObject;\n    }\n    if (args.principalName !== undefined) {\n      this.principalName = args.principalName;\n    }\n    if (args.principalType !== undefined) {\n      this.principalType = args.principalType;\n    }\n    if (args.grantInfo !== undefined) {\n      this.grantInfo = args.grantInfo;\n    }\n  }\n};\nHiveObjectPrivilege.prototype = {};\nHiveObjectPrivilege.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.hiveObject = new ttypes.HiveObjectRef();\n        this.hiveObject.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.principalName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.principalType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.grantInfo = new ttypes.PrivilegeGrantInfo();\n        this.grantInfo.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nHiveObjectPrivilege.prototype.write = function(output) {\n  output.writeStructBegin('HiveObjectPrivilege');\n  if (this.hiveObject) {\n    output.writeFieldBegin('hiveObject', Thrift.Type.STRUCT, 1);\n    this.hiveObject.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.principalName) {\n    output.writeFieldBegin('principalName', Thrift.Type.STRING, 2);\n    output.writeString(this.principalName);\n    output.writeFieldEnd();\n  }\n  if (this.principalType) {\n    output.writeFieldBegin('principalType', Thrift.Type.I32, 3);\n    output.writeI32(this.principalType);\n    output.writeFieldEnd();\n  }\n  if (this.grantInfo) {\n    output.writeFieldBegin('grantInfo', Thrift.Type.STRUCT, 4);\n    this.grantInfo.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar PrivilegeBag = module.exports.PrivilegeBag = function(args) {\n  this.privileges = null;\n  if (args) {\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nPrivilegeBag.prototype = {};\nPrivilegeBag.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size16 = 0;\n        var _rtmp320;\n        this.privileges = [];\n        var _etype19 = 0;\n        _rtmp320 = input.readListBegin();\n        _etype19 = _rtmp320.etype;\n        _size16 = _rtmp320.size;\n        for (var _i21 = 0; _i21 < _size16; ++_i21)\n        {\n          var elem22 = null;\n          elem22 = new ttypes.HiveObjectPrivilege();\n          elem22.read(input);\n          this.privileges.push(elem22);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nPrivilegeBag.prototype.write = function(output) {\n  output.writeStructBegin('PrivilegeBag');\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.privileges.length);\n    for (var iter23 in this.privileges)\n    {\n      if (this.privileges.hasOwnProperty(iter23))\n      {\n        iter23 = this.privileges[iter23];\n        iter23.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar PrincipalPrivilegeSet = module.exports.PrincipalPrivilegeSet = function(args) {\n  this.userPrivileges = null;\n  this.groupPrivileges = null;\n  this.rolePrivileges = null;\n  if (args) {\n    if (args.userPrivileges !== undefined) {\n      this.userPrivileges = args.userPrivileges;\n    }\n    if (args.groupPrivileges !== undefined) {\n      this.groupPrivileges = args.groupPrivileges;\n    }\n    if (args.rolePrivileges !== undefined) {\n      this.rolePrivileges = args.rolePrivileges;\n    }\n  }\n};\nPrincipalPrivilegeSet.prototype = {};\nPrincipalPrivilegeSet.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.MAP) {\n        var _size24 = 0;\n        var _rtmp328;\n        this.userPrivileges = {};\n        var _ktype25 = 0;\n        var _vtype26 = 0;\n        _rtmp328 = input.readMapBegin();\n        _ktype25 = _rtmp328.ktype;\n        _vtype26 = _rtmp328.vtype;\n        _size24 = _rtmp328.size;\n        for (var _i29 = 0; _i29 < _size24; ++_i29)\n        {\n          if (_i29 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key30 = null;\n          var val31 = null;\n          key30 = input.readString();\n          var _size32 = 0;\n          var _rtmp336;\n          val31 = [];\n          var _etype35 = 0;\n          _rtmp336 = input.readListBegin();\n          _etype35 = _rtmp336.etype;\n          _size32 = _rtmp336.size;\n          for (var _i37 = 0; _i37 < _size32; ++_i37)\n          {\n            var elem38 = null;\n            elem38 = new ttypes.PrivilegeGrantInfo();\n            elem38.read(input);\n            val31.push(elem38);\n          }\n          input.readListEnd();\n          this.userPrivileges[key30] = val31;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.MAP) {\n        var _size39 = 0;\n        var _rtmp343;\n        this.groupPrivileges = {};\n        var _ktype40 = 0;\n        var _vtype41 = 0;\n        _rtmp343 = input.readMapBegin();\n        _ktype40 = _rtmp343.ktype;\n        _vtype41 = _rtmp343.vtype;\n        _size39 = _rtmp343.size;\n        for (var _i44 = 0; _i44 < _size39; ++_i44)\n        {\n          if (_i44 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key45 = null;\n          var val46 = null;\n          key45 = input.readString();\n          var _size47 = 0;\n          var _rtmp351;\n          val46 = [];\n          var _etype50 = 0;\n          _rtmp351 = input.readListBegin();\n          _etype50 = _rtmp351.etype;\n          _size47 = _rtmp351.size;\n          for (var _i52 = 0; _i52 < _size47; ++_i52)\n          {\n            var elem53 = null;\n            elem53 = new ttypes.PrivilegeGrantInfo();\n            elem53.read(input);\n            val46.push(elem53);\n          }\n          input.readListEnd();\n          this.groupPrivileges[key45] = val46;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size54 = 0;\n        var _rtmp358;\n        this.rolePrivileges = {};\n        var _ktype55 = 0;\n        var _vtype56 = 0;\n        _rtmp358 = input.readMapBegin();\n        _ktype55 = _rtmp358.ktype;\n        _vtype56 = _rtmp358.vtype;\n        _size54 = _rtmp358.size;\n        for (var _i59 = 0; _i59 < _size54; ++_i59)\n        {\n          if (_i59 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key60 = null;\n          var val61 = null;\n          key60 = input.readString();\n          var _size62 = 0;\n          var _rtmp366;\n          val61 = [];\n          var _etype65 = 0;\n          _rtmp366 = input.readListBegin();\n          _etype65 = _rtmp366.etype;\n          _size62 = _rtmp366.size;\n          for (var _i67 = 0; _i67 < _size62; ++_i67)\n          {\n            var elem68 = null;\n            elem68 = new ttypes.PrivilegeGrantInfo();\n            elem68.read(input);\n            val61.push(elem68);\n          }\n          input.readListEnd();\n          this.rolePrivileges[key60] = val61;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nPrincipalPrivilegeSet.prototype.write = function(output) {\n  output.writeStructBegin('PrincipalPrivilegeSet');\n  if (this.userPrivileges) {\n    output.writeFieldBegin('userPrivileges', Thrift.Type.MAP, 1);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.userPrivileges));\n    for (var kiter69 in this.userPrivileges)\n    {\n      if (this.userPrivileges.hasOwnProperty(kiter69))\n      {\n        var viter70 = this.userPrivileges[kiter69];\n        output.writeString(kiter69);\n        output.writeListBegin(Thrift.Type.STRUCT, viter70.length);\n        for (var iter71 in viter70)\n        {\n          if (viter70.hasOwnProperty(iter71))\n          {\n            iter71 = viter70[iter71];\n            iter71.write(output);\n          }\n        }\n        output.writeListEnd();\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.groupPrivileges) {\n    output.writeFieldBegin('groupPrivileges', Thrift.Type.MAP, 2);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.groupPrivileges));\n    for (var kiter72 in this.groupPrivileges)\n    {\n      if (this.groupPrivileges.hasOwnProperty(kiter72))\n      {\n        var viter73 = this.groupPrivileges[kiter72];\n        output.writeString(kiter72);\n        output.writeListBegin(Thrift.Type.STRUCT, viter73.length);\n        for (var iter74 in viter73)\n        {\n          if (viter73.hasOwnProperty(iter74))\n          {\n            iter74 = viter73[iter74];\n            iter74.write(output);\n          }\n        }\n        output.writeListEnd();\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.rolePrivileges) {\n    output.writeFieldBegin('rolePrivileges', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.LIST, Thrift.objectLength(this.rolePrivileges));\n    for (var kiter75 in this.rolePrivileges)\n    {\n      if (this.rolePrivileges.hasOwnProperty(kiter75))\n      {\n        var viter76 = this.rolePrivileges[kiter75];\n        output.writeString(kiter75);\n        output.writeListBegin(Thrift.Type.STRUCT, viter76.length);\n        for (var iter77 in viter76)\n        {\n          if (viter76.hasOwnProperty(iter77))\n          {\n            iter77 = viter76[iter77];\n            iter77.write(output);\n          }\n        }\n        output.writeListEnd();\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Role = module.exports.Role = function(args) {\n  this.roleName = null;\n  this.createTime = null;\n  this.ownerName = null;\n  if (args) {\n    if (args.roleName !== undefined) {\n      this.roleName = args.roleName;\n    }\n    if (args.createTime !== undefined) {\n      this.createTime = args.createTime;\n    }\n    if (args.ownerName !== undefined) {\n      this.ownerName = args.ownerName;\n    }\n  }\n};\nRole.prototype = {};\nRole.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.roleName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.createTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.ownerName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nRole.prototype.write = function(output) {\n  output.writeStructBegin('Role');\n  if (this.roleName) {\n    output.writeFieldBegin('roleName', Thrift.Type.STRING, 1);\n    output.writeString(this.roleName);\n    output.writeFieldEnd();\n  }\n  if (this.createTime) {\n    output.writeFieldBegin('createTime', Thrift.Type.I32, 2);\n    output.writeI32(this.createTime);\n    output.writeFieldEnd();\n  }\n  if (this.ownerName) {\n    output.writeFieldBegin('ownerName', Thrift.Type.STRING, 3);\n    output.writeString(this.ownerName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Database = module.exports.Database = function(args) {\n  this.name = null;\n  this.description = null;\n  this.locationUri = null;\n  this.parameters = null;\n  this.privileges = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.description !== undefined) {\n      this.description = args.description;\n    }\n    if (args.locationUri !== undefined) {\n      this.locationUri = args.locationUri;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nDatabase.prototype = {};\nDatabase.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.description = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.locationUri = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size78 = 0;\n        var _rtmp382;\n        this.parameters = {};\n        var _ktype79 = 0;\n        var _vtype80 = 0;\n        _rtmp382 = input.readMapBegin();\n        _ktype79 = _rtmp382.ktype;\n        _vtype80 = _rtmp382.vtype;\n        _size78 = _rtmp382.size;\n        for (var _i83 = 0; _i83 < _size78; ++_i83)\n        {\n          if (_i83 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key84 = null;\n          var val85 = null;\n          key84 = input.readString();\n          val85 = input.readString();\n          this.parameters[key84] = val85;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.privileges = new ttypes.PrincipalPrivilegeSet();\n        this.privileges.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nDatabase.prototype.write = function(output) {\n  output.writeStructBegin('Database');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.description) {\n    output.writeFieldBegin('description', Thrift.Type.STRING, 2);\n    output.writeString(this.description);\n    output.writeFieldEnd();\n  }\n  if (this.locationUri) {\n    output.writeFieldBegin('locationUri', Thrift.Type.STRING, 3);\n    output.writeString(this.locationUri);\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter86 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter86))\n      {\n        var viter87 = this.parameters[kiter86];\n        output.writeString(kiter86);\n        output.writeString(viter87);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 5);\n    this.privileges.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar SerDeInfo = module.exports.SerDeInfo = function(args) {\n  this.name = null;\n  this.serializationLib = null;\n  this.parameters = null;\n  if (args) {\n    if (args.name !== undefined) {\n      this.name = args.name;\n    }\n    if (args.serializationLib !== undefined) {\n      this.serializationLib = args.serializationLib;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n  }\n};\nSerDeInfo.prototype = {};\nSerDeInfo.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.name = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.serializationLib = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size88 = 0;\n        var _rtmp392;\n        this.parameters = {};\n        var _ktype89 = 0;\n        var _vtype90 = 0;\n        _rtmp392 = input.readMapBegin();\n        _ktype89 = _rtmp392.ktype;\n        _vtype90 = _rtmp392.vtype;\n        _size88 = _rtmp392.size;\n        for (var _i93 = 0; _i93 < _size88; ++_i93)\n        {\n          if (_i93 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key94 = null;\n          var val95 = null;\n          key94 = input.readString();\n          val95 = input.readString();\n          this.parameters[key94] = val95;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nSerDeInfo.prototype.write = function(output) {\n  output.writeStructBegin('SerDeInfo');\n  if (this.name) {\n    output.writeFieldBegin('name', Thrift.Type.STRING, 1);\n    output.writeString(this.name);\n    output.writeFieldEnd();\n  }\n  if (this.serializationLib) {\n    output.writeFieldBegin('serializationLib', Thrift.Type.STRING, 2);\n    output.writeString(this.serializationLib);\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter96 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter96))\n      {\n        var viter97 = this.parameters[kiter96];\n        output.writeString(kiter96);\n        output.writeString(viter97);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Order = module.exports.Order = function(args) {\n  this.col = null;\n  this.order = null;\n  if (args) {\n    if (args.col !== undefined) {\n      this.col = args.col;\n    }\n    if (args.order !== undefined) {\n      this.order = args.order;\n    }\n  }\n};\nOrder.prototype = {};\nOrder.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.col = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.order = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nOrder.prototype.write = function(output) {\n  output.writeStructBegin('Order');\n  if (this.col) {\n    output.writeFieldBegin('col', Thrift.Type.STRING, 1);\n    output.writeString(this.col);\n    output.writeFieldEnd();\n  }\n  if (this.order) {\n    output.writeFieldBegin('order', Thrift.Type.I32, 2);\n    output.writeI32(this.order);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar StorageDescriptor = module.exports.StorageDescriptor = function(args) {\n  this.cols = null;\n  this.location = null;\n  this.inputFormat = null;\n  this.outputFormat = null;\n  this.compressed = null;\n  this.numBuckets = null;\n  this.serdeInfo = null;\n  this.bucketCols = null;\n  this.sortCols = null;\n  this.parameters = null;\n  if (args) {\n    if (args.cols !== undefined) {\n      this.cols = args.cols;\n    }\n    if (args.location !== undefined) {\n      this.location = args.location;\n    }\n    if (args.inputFormat !== undefined) {\n      this.inputFormat = args.inputFormat;\n    }\n    if (args.outputFormat !== undefined) {\n      this.outputFormat = args.outputFormat;\n    }\n    if (args.compressed !== undefined) {\n      this.compressed = args.compressed;\n    }\n    if (args.numBuckets !== undefined) {\n      this.numBuckets = args.numBuckets;\n    }\n    if (args.serdeInfo !== undefined) {\n      this.serdeInfo = args.serdeInfo;\n    }\n    if (args.bucketCols !== undefined) {\n      this.bucketCols = args.bucketCols;\n    }\n    if (args.sortCols !== undefined) {\n      this.sortCols = args.sortCols;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n  }\n};\nStorageDescriptor.prototype = {};\nStorageDescriptor.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size98 = 0;\n        var _rtmp3102;\n        this.cols = [];\n        var _etype101 = 0;\n        _rtmp3102 = input.readListBegin();\n        _etype101 = _rtmp3102.etype;\n        _size98 = _rtmp3102.size;\n        for (var _i103 = 0; _i103 < _size98; ++_i103)\n        {\n          var elem104 = null;\n          elem104 = new ttypes.FieldSchema();\n          elem104.read(input);\n          this.cols.push(elem104);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.location = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.inputFormat = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.outputFormat = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.BOOL) {\n        this.compressed = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.I32) {\n        this.numBuckets = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.serdeInfo = new ttypes.SerDeInfo();\n        this.serdeInfo.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.LIST) {\n        var _size105 = 0;\n        var _rtmp3109;\n        this.bucketCols = [];\n        var _etype108 = 0;\n        _rtmp3109 = input.readListBegin();\n        _etype108 = _rtmp3109.etype;\n        _size105 = _rtmp3109.size;\n        for (var _i110 = 0; _i110 < _size105; ++_i110)\n        {\n          var elem111 = null;\n          elem111 = input.readString();\n          this.bucketCols.push(elem111);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 9:\n      if (ftype == Thrift.Type.LIST) {\n        var _size112 = 0;\n        var _rtmp3116;\n        this.sortCols = [];\n        var _etype115 = 0;\n        _rtmp3116 = input.readListBegin();\n        _etype115 = _rtmp3116.etype;\n        _size112 = _rtmp3116.size;\n        for (var _i117 = 0; _i117 < _size112; ++_i117)\n        {\n          var elem118 = null;\n          elem118 = new ttypes.Order();\n          elem118.read(input);\n          this.sortCols.push(elem118);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 10:\n      if (ftype == Thrift.Type.MAP) {\n        var _size119 = 0;\n        var _rtmp3123;\n        this.parameters = {};\n        var _ktype120 = 0;\n        var _vtype121 = 0;\n        _rtmp3123 = input.readMapBegin();\n        _ktype120 = _rtmp3123.ktype;\n        _vtype121 = _rtmp3123.vtype;\n        _size119 = _rtmp3123.size;\n        for (var _i124 = 0; _i124 < _size119; ++_i124)\n        {\n          if (_i124 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key125 = null;\n          var val126 = null;\n          key125 = input.readString();\n          val126 = input.readString();\n          this.parameters[key125] = val126;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nStorageDescriptor.prototype.write = function(output) {\n  output.writeStructBegin('StorageDescriptor');\n  if (this.cols) {\n    output.writeFieldBegin('cols', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.cols.length);\n    for (var iter127 in this.cols)\n    {\n      if (this.cols.hasOwnProperty(iter127))\n      {\n        iter127 = this.cols[iter127];\n        iter127.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.location) {\n    output.writeFieldBegin('location', Thrift.Type.STRING, 2);\n    output.writeString(this.location);\n    output.writeFieldEnd();\n  }\n  if (this.inputFormat) {\n    output.writeFieldBegin('inputFormat', Thrift.Type.STRING, 3);\n    output.writeString(this.inputFormat);\n    output.writeFieldEnd();\n  }\n  if (this.outputFormat) {\n    output.writeFieldBegin('outputFormat', Thrift.Type.STRING, 4);\n    output.writeString(this.outputFormat);\n    output.writeFieldEnd();\n  }\n  if (this.compressed) {\n    output.writeFieldBegin('compressed', Thrift.Type.BOOL, 5);\n    output.writeBool(this.compressed);\n    output.writeFieldEnd();\n  }\n  if (this.numBuckets) {\n    output.writeFieldBegin('numBuckets', Thrift.Type.I32, 6);\n    output.writeI32(this.numBuckets);\n    output.writeFieldEnd();\n  }\n  if (this.serdeInfo) {\n    output.writeFieldBegin('serdeInfo', Thrift.Type.STRUCT, 7);\n    this.serdeInfo.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.bucketCols) {\n    output.writeFieldBegin('bucketCols', Thrift.Type.LIST, 8);\n    output.writeListBegin(Thrift.Type.STRING, this.bucketCols.length);\n    for (var iter128 in this.bucketCols)\n    {\n      if (this.bucketCols.hasOwnProperty(iter128))\n      {\n        iter128 = this.bucketCols[iter128];\n        output.writeString(iter128);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.sortCols) {\n    output.writeFieldBegin('sortCols', Thrift.Type.LIST, 9);\n    output.writeListBegin(Thrift.Type.STRUCT, this.sortCols.length);\n    for (var iter129 in this.sortCols)\n    {\n      if (this.sortCols.hasOwnProperty(iter129))\n      {\n        iter129 = this.sortCols[iter129];\n        iter129.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 10);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter130 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter130))\n      {\n        var viter131 = this.parameters[kiter130];\n        output.writeString(kiter130);\n        output.writeString(viter131);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Table = module.exports.Table = function(args) {\n  this.tableName = null;\n  this.dbName = null;\n  this.owner = null;\n  this.createTime = null;\n  this.lastAccessTime = null;\n  this.retention = null;\n  this.sd = null;\n  this.partitionKeys = null;\n  this.parameters = null;\n  this.viewOriginalText = null;\n  this.viewExpandedText = null;\n  this.tableType = null;\n  this.privileges = null;\n  if (args) {\n    if (args.tableName !== undefined) {\n      this.tableName = args.tableName;\n    }\n    if (args.dbName !== undefined) {\n      this.dbName = args.dbName;\n    }\n    if (args.owner !== undefined) {\n      this.owner = args.owner;\n    }\n    if (args.createTime !== undefined) {\n      this.createTime = args.createTime;\n    }\n    if (args.lastAccessTime !== undefined) {\n      this.lastAccessTime = args.lastAccessTime;\n    }\n    if (args.retention !== undefined) {\n      this.retention = args.retention;\n    }\n    if (args.sd !== undefined) {\n      this.sd = args.sd;\n    }\n    if (args.partitionKeys !== undefined) {\n      this.partitionKeys = args.partitionKeys;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n    if (args.viewOriginalText !== undefined) {\n      this.viewOriginalText = args.viewOriginalText;\n    }\n    if (args.viewExpandedText !== undefined) {\n      this.viewExpandedText = args.viewExpandedText;\n    }\n    if (args.tableType !== undefined) {\n      this.tableType = args.tableType;\n    }\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nTable.prototype = {};\nTable.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.tableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.owner = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.createTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.lastAccessTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.I32) {\n        this.retention = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sd = new ttypes.StorageDescriptor();\n        this.sd.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.LIST) {\n        var _size132 = 0;\n        var _rtmp3136;\n        this.partitionKeys = [];\n        var _etype135 = 0;\n        _rtmp3136 = input.readListBegin();\n        _etype135 = _rtmp3136.etype;\n        _size132 = _rtmp3136.size;\n        for (var _i137 = 0; _i137 < _size132; ++_i137)\n        {\n          var elem138 = null;\n          elem138 = new ttypes.FieldSchema();\n          elem138.read(input);\n          this.partitionKeys.push(elem138);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 9:\n      if (ftype == Thrift.Type.MAP) {\n        var _size139 = 0;\n        var _rtmp3143;\n        this.parameters = {};\n        var _ktype140 = 0;\n        var _vtype141 = 0;\n        _rtmp3143 = input.readMapBegin();\n        _ktype140 = _rtmp3143.ktype;\n        _vtype141 = _rtmp3143.vtype;\n        _size139 = _rtmp3143.size;\n        for (var _i144 = 0; _i144 < _size139; ++_i144)\n        {\n          if (_i144 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key145 = null;\n          var val146 = null;\n          key145 = input.readString();\n          val146 = input.readString();\n          this.parameters[key145] = val146;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 10:\n      if (ftype == Thrift.Type.STRING) {\n        this.viewOriginalText = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 11:\n      if (ftype == Thrift.Type.STRING) {\n        this.viewExpandedText = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 12:\n      if (ftype == Thrift.Type.STRING) {\n        this.tableType = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 13:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.privileges = new ttypes.PrincipalPrivilegeSet();\n        this.privileges.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTable.prototype.write = function(output) {\n  output.writeStructBegin('Table');\n  if (this.tableName) {\n    output.writeFieldBegin('tableName', Thrift.Type.STRING, 1);\n    output.writeString(this.tableName);\n    output.writeFieldEnd();\n  }\n  if (this.dbName) {\n    output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);\n    output.writeString(this.dbName);\n    output.writeFieldEnd();\n  }\n  if (this.owner) {\n    output.writeFieldBegin('owner', Thrift.Type.STRING, 3);\n    output.writeString(this.owner);\n    output.writeFieldEnd();\n  }\n  if (this.createTime) {\n    output.writeFieldBegin('createTime', Thrift.Type.I32, 4);\n    output.writeI32(this.createTime);\n    output.writeFieldEnd();\n  }\n  if (this.lastAccessTime) {\n    output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 5);\n    output.writeI32(this.lastAccessTime);\n    output.writeFieldEnd();\n  }\n  if (this.retention) {\n    output.writeFieldBegin('retention', Thrift.Type.I32, 6);\n    output.writeI32(this.retention);\n    output.writeFieldEnd();\n  }\n  if (this.sd) {\n    output.writeFieldBegin('sd', Thrift.Type.STRUCT, 7);\n    this.sd.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.partitionKeys) {\n    output.writeFieldBegin('partitionKeys', Thrift.Type.LIST, 8);\n    output.writeListBegin(Thrift.Type.STRUCT, this.partitionKeys.length);\n    for (var iter147 in this.partitionKeys)\n    {\n      if (this.partitionKeys.hasOwnProperty(iter147))\n      {\n        iter147 = this.partitionKeys[iter147];\n        iter147.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 9);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter148 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter148))\n      {\n        var viter149 = this.parameters[kiter148];\n        output.writeString(kiter148);\n        output.writeString(viter149);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.viewOriginalText) {\n    output.writeFieldBegin('viewOriginalText', Thrift.Type.STRING, 10);\n    output.writeString(this.viewOriginalText);\n    output.writeFieldEnd();\n  }\n  if (this.viewExpandedText) {\n    output.writeFieldBegin('viewExpandedText', Thrift.Type.STRING, 11);\n    output.writeString(this.viewExpandedText);\n    output.writeFieldEnd();\n  }\n  if (this.tableType) {\n    output.writeFieldBegin('tableType', Thrift.Type.STRING, 12);\n    output.writeString(this.tableType);\n    output.writeFieldEnd();\n  }\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 13);\n    this.privileges.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Partition = module.exports.Partition = function(args) {\n  this.values = null;\n  this.dbName = null;\n  this.tableName = null;\n  this.createTime = null;\n  this.lastAccessTime = null;\n  this.sd = null;\n  this.parameters = null;\n  this.privileges = null;\n  if (args) {\n    if (args.values !== undefined) {\n      this.values = args.values;\n    }\n    if (args.dbName !== undefined) {\n      this.dbName = args.dbName;\n    }\n    if (args.tableName !== undefined) {\n      this.tableName = args.tableName;\n    }\n    if (args.createTime !== undefined) {\n      this.createTime = args.createTime;\n    }\n    if (args.lastAccessTime !== undefined) {\n      this.lastAccessTime = args.lastAccessTime;\n    }\n    if (args.sd !== undefined) {\n      this.sd = args.sd;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n    if (args.privileges !== undefined) {\n      this.privileges = args.privileges;\n    }\n  }\n};\nPartition.prototype = {};\nPartition.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size150 = 0;\n        var _rtmp3154;\n        this.values = [];\n        var _etype153 = 0;\n        _rtmp3154 = input.readListBegin();\n        _etype153 = _rtmp3154.etype;\n        _size150 = _rtmp3154.size;\n        for (var _i155 = 0; _i155 < _size150; ++_i155)\n        {\n          var elem156 = null;\n          elem156 = input.readString();\n          this.values.push(elem156);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.tableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.createTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.lastAccessTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sd = new ttypes.StorageDescriptor();\n        this.sd.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.MAP) {\n        var _size157 = 0;\n        var _rtmp3161;\n        this.parameters = {};\n        var _ktype158 = 0;\n        var _vtype159 = 0;\n        _rtmp3161 = input.readMapBegin();\n        _ktype158 = _rtmp3161.ktype;\n        _vtype159 = _rtmp3161.vtype;\n        _size157 = _rtmp3161.size;\n        for (var _i162 = 0; _i162 < _size157; ++_i162)\n        {\n          if (_i162 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key163 = null;\n          var val164 = null;\n          key163 = input.readString();\n          val164 = input.readString();\n          this.parameters[key163] = val164;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.privileges = new ttypes.PrincipalPrivilegeSet();\n        this.privileges.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nPartition.prototype.write = function(output) {\n  output.writeStructBegin('Partition');\n  if (this.values) {\n    output.writeFieldBegin('values', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRING, this.values.length);\n    for (var iter165 in this.values)\n    {\n      if (this.values.hasOwnProperty(iter165))\n      {\n        iter165 = this.values[iter165];\n        output.writeString(iter165);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.dbName) {\n    output.writeFieldBegin('dbName', Thrift.Type.STRING, 2);\n    output.writeString(this.dbName);\n    output.writeFieldEnd();\n  }\n  if (this.tableName) {\n    output.writeFieldBegin('tableName', Thrift.Type.STRING, 3);\n    output.writeString(this.tableName);\n    output.writeFieldEnd();\n  }\n  if (this.createTime) {\n    output.writeFieldBegin('createTime', Thrift.Type.I32, 4);\n    output.writeI32(this.createTime);\n    output.writeFieldEnd();\n  }\n  if (this.lastAccessTime) {\n    output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 5);\n    output.writeI32(this.lastAccessTime);\n    output.writeFieldEnd();\n  }\n  if (this.sd) {\n    output.writeFieldBegin('sd', Thrift.Type.STRUCT, 6);\n    this.sd.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 7);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter166 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter166))\n      {\n        var viter167 = this.parameters[kiter166];\n        output.writeString(kiter166);\n        output.writeString(viter167);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.privileges) {\n    output.writeFieldBegin('privileges', Thrift.Type.STRUCT, 8);\n    this.privileges.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Index = module.exports.Index = function(args) {\n  this.indexName = null;\n  this.indexHandlerClass = null;\n  this.dbName = null;\n  this.origTableName = null;\n  this.createTime = null;\n  this.lastAccessTime = null;\n  this.indexTableName = null;\n  this.sd = null;\n  this.parameters = null;\n  this.deferredRebuild = null;\n  if (args) {\n    if (args.indexName !== undefined) {\n      this.indexName = args.indexName;\n    }\n    if (args.indexHandlerClass !== undefined) {\n      this.indexHandlerClass = args.indexHandlerClass;\n    }\n    if (args.dbName !== undefined) {\n      this.dbName = args.dbName;\n    }\n    if (args.origTableName !== undefined) {\n      this.origTableName = args.origTableName;\n    }\n    if (args.createTime !== undefined) {\n      this.createTime = args.createTime;\n    }\n    if (args.lastAccessTime !== undefined) {\n      this.lastAccessTime = args.lastAccessTime;\n    }\n    if (args.indexTableName !== undefined) {\n      this.indexTableName = args.indexTableName;\n    }\n    if (args.sd !== undefined) {\n      this.sd = args.sd;\n    }\n    if (args.parameters !== undefined) {\n      this.parameters = args.parameters;\n    }\n    if (args.deferredRebuild !== undefined) {\n      this.deferredRebuild = args.deferredRebuild;\n    }\n  }\n};\nIndex.prototype = {};\nIndex.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.indexName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.indexHandlerClass = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.dbName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.origTableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.createTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.I32) {\n        this.lastAccessTime = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.STRING) {\n        this.indexTableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sd = new ttypes.StorageDescriptor();\n        this.sd.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 9:\n      if (ftype == Thrift.Type.MAP) {\n        var _size168 = 0;\n        var _rtmp3172;\n        this.parameters = {};\n        var _ktype169 = 0;\n        var _vtype170 = 0;\n        _rtmp3172 = input.readMapBegin();\n        _ktype169 = _rtmp3172.ktype;\n        _vtype170 = _rtmp3172.vtype;\n        _size168 = _rtmp3172.size;\n        for (var _i173 = 0; _i173 < _size168; ++_i173)\n        {\n          if (_i173 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key174 = null;\n          var val175 = null;\n          key174 = input.readString();\n          val175 = input.readString();\n          this.parameters[key174] = val175;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 10:\n      if (ftype == Thrift.Type.BOOL) {\n        this.deferredRebuild = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nIndex.prototype.write = function(output) {\n  output.writeStructBegin('Index');\n  if (this.indexName) {\n    output.writeFieldBegin('indexName', Thrift.Type.STRING, 1);\n    output.writeString(this.indexName);\n    output.writeFieldEnd();\n  }\n  if (this.indexHandlerClass) {\n    output.writeFieldBegin('indexHandlerClass', Thrift.Type.STRING, 2);\n    output.writeString(this.indexHandlerClass);\n    output.writeFieldEnd();\n  }\n  if (this.dbName) {\n    output.writeFieldBegin('dbName', Thrift.Type.STRING, 3);\n    output.writeString(this.dbName);\n    output.writeFieldEnd();\n  }\n  if (this.origTableName) {\n    output.writeFieldBegin('origTableName', Thrift.Type.STRING, 4);\n    output.writeString(this.origTableName);\n    output.writeFieldEnd();\n  }\n  if (this.createTime) {\n    output.writeFieldBegin('createTime', Thrift.Type.I32, 5);\n    output.writeI32(this.createTime);\n    output.writeFieldEnd();\n  }\n  if (this.lastAccessTime) {\n    output.writeFieldBegin('lastAccessTime', Thrift.Type.I32, 6);\n    output.writeI32(this.lastAccessTime);\n    output.writeFieldEnd();\n  }\n  if (this.indexTableName) {\n    output.writeFieldBegin('indexTableName', Thrift.Type.STRING, 7);\n    output.writeString(this.indexTableName);\n    output.writeFieldEnd();\n  }\n  if (this.sd) {\n    output.writeFieldBegin('sd', Thrift.Type.STRUCT, 8);\n    this.sd.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.parameters) {\n    output.writeFieldBegin('parameters', Thrift.Type.MAP, 9);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));\n    for (var kiter176 in this.parameters)\n    {\n      if (this.parameters.hasOwnProperty(kiter176))\n      {\n        var viter177 = this.parameters[kiter176];\n        output.writeString(kiter176);\n        output.writeString(viter177);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.deferredRebuild) {\n    output.writeFieldBegin('deferredRebuild', Thrift.Type.BOOL, 10);\n    output.writeBool(this.deferredRebuild);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Schema = module.exports.Schema = function(args) {\n  this.fieldSchemas = null;\n  this.properties = null;\n  if (args) {\n    if (args.fieldSchemas !== undefined) {\n      this.fieldSchemas = args.fieldSchemas;\n    }\n    if (args.properties !== undefined) {\n      this.properties = args.properties;\n    }\n  }\n};\nSchema.prototype = {};\nSchema.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size178 = 0;\n        var _rtmp3182;\n        this.fieldSchemas = [];\n        var _etype181 = 0;\n        _rtmp3182 = input.readListBegin();\n        _etype181 = _rtmp3182.etype;\n        _size178 = _rtmp3182.size;\n        for (var _i183 = 0; _i183 < _size178; ++_i183)\n        {\n          var elem184 = null;\n          elem184 = new ttypes.FieldSchema();\n          elem184.read(input);\n          this.fieldSchemas.push(elem184);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.MAP) {\n        var _size185 = 0;\n        var _rtmp3189;\n        this.properties = {};\n        var _ktype186 = 0;\n        var _vtype187 = 0;\n        _rtmp3189 = input.readMapBegin();\n        _ktype186 = _rtmp3189.ktype;\n        _vtype187 = _rtmp3189.vtype;\n        _size185 = _rtmp3189.size;\n        for (var _i190 = 0; _i190 < _size185; ++_i190)\n        {\n          if (_i190 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key191 = null;\n          var val192 = null;\n          key191 = input.readString();\n          val192 = input.readString();\n          this.properties[key191] = val192;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nSchema.prototype.write = function(output) {\n  output.writeStructBegin('Schema');\n  if (this.fieldSchemas) {\n    output.writeFieldBegin('fieldSchemas', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.fieldSchemas.length);\n    for (var iter193 in this.fieldSchemas)\n    {\n      if (this.fieldSchemas.hasOwnProperty(iter193))\n      {\n        iter193 = this.fieldSchemas[iter193];\n        iter193.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.properties) {\n    output.writeFieldBegin('properties', Thrift.Type.MAP, 2);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.properties));\n    for (var kiter194 in this.properties)\n    {\n      if (this.properties.hasOwnProperty(kiter194))\n      {\n        var viter195 = this.properties[kiter194];\n        output.writeString(kiter194);\n        output.writeString(viter195);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar MetaException = module.exports.MetaException = function(args) {\n  Thrift.TException.call(this, \"MetaException\")\n  this.name = \"MetaException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(MetaException, Thrift.TException);\nMetaException.prototype.name = 'MetaException';\nMetaException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nMetaException.prototype.write = function(output) {\n  output.writeStructBegin('MetaException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar UnknownTableException = module.exports.UnknownTableException = function(args) {\n  Thrift.TException.call(this, \"UnknownTableException\")\n  this.name = \"UnknownTableException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(UnknownTableException, Thrift.TException);\nUnknownTableException.prototype.name = 'UnknownTableException';\nUnknownTableException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nUnknownTableException.prototype.write = function(output) {\n  output.writeStructBegin('UnknownTableException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar UnknownDBException = module.exports.UnknownDBException = function(args) {\n  Thrift.TException.call(this, \"UnknownDBException\")\n  this.name = \"UnknownDBException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(UnknownDBException, Thrift.TException);\nUnknownDBException.prototype.name = 'UnknownDBException';\nUnknownDBException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nUnknownDBException.prototype.write = function(output) {\n  output.writeStructBegin('UnknownDBException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar AlreadyExistsException = module.exports.AlreadyExistsException = function(args) {\n  Thrift.TException.call(this, \"AlreadyExistsException\")\n  this.name = \"AlreadyExistsException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(AlreadyExistsException, Thrift.TException);\nAlreadyExistsException.prototype.name = 'AlreadyExistsException';\nAlreadyExistsException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nAlreadyExistsException.prototype.write = function(output) {\n  output.writeStructBegin('AlreadyExistsException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar InvalidObjectException = module.exports.InvalidObjectException = function(args) {\n  Thrift.TException.call(this, \"InvalidObjectException\")\n  this.name = \"InvalidObjectException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(InvalidObjectException, Thrift.TException);\nInvalidObjectException.prototype.name = 'InvalidObjectException';\nInvalidObjectException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nInvalidObjectException.prototype.write = function(output) {\n  output.writeStructBegin('InvalidObjectException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar NoSuchObjectException = module.exports.NoSuchObjectException = function(args) {\n  Thrift.TException.call(this, \"NoSuchObjectException\")\n  this.name = \"NoSuchObjectException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(NoSuchObjectException, Thrift.TException);\nNoSuchObjectException.prototype.name = 'NoSuchObjectException';\nNoSuchObjectException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nNoSuchObjectException.prototype.write = function(output) {\n  output.writeStructBegin('NoSuchObjectException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar IndexAlreadyExistsException = module.exports.IndexAlreadyExistsException = function(args) {\n  Thrift.TException.call(this, \"IndexAlreadyExistsException\")\n  this.name = \"IndexAlreadyExistsException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(IndexAlreadyExistsException, Thrift.TException);\nIndexAlreadyExistsException.prototype.name = 'IndexAlreadyExistsException';\nIndexAlreadyExistsException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nIndexAlreadyExistsException.prototype.write = function(output) {\n  output.writeStructBegin('IndexAlreadyExistsException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar InvalidOperationException = module.exports.InvalidOperationException = function(args) {\n  Thrift.TException.call(this, \"InvalidOperationException\")\n  this.name = \"InvalidOperationException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(InvalidOperationException, Thrift.TException);\nInvalidOperationException.prototype.name = 'InvalidOperationException';\nInvalidOperationException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nInvalidOperationException.prototype.write = function(output) {\n  output.writeStructBegin('InvalidOperationException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar ConfigValSecurityException = module.exports.ConfigValSecurityException = function(args) {\n  Thrift.TException.call(this, \"ConfigValSecurityException\")\n  this.name = \"ConfigValSecurityException\"\n  this.message = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n  }\n};\nThrift.inherits(ConfigValSecurityException, Thrift.TException);\nConfigValSecurityException.prototype.name = 'ConfigValSecurityException';\nConfigValSecurityException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nConfigValSecurityException.prototype.write = function(output) {\n  output.writeStructBegin('ConfigValSecurityException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nttypes.DDL_TIME = 'transient_lastDdlTime';\nttypes.IS_ARCHIVED = 'is_archived';\nttypes.ORIGINAL_LOCATION = 'original_location';\nttypes.META_TABLE_COLUMNS = 'columns';\nttypes.META_TABLE_COLUMN_TYPES = 'columns.types';\nttypes.BUCKET_FIELD_NAME = 'bucket_field_name';\nttypes.BUCKET_COUNT = 'bucket_count';\nttypes.FIELD_TO_DIMENSION = 'field_to_dimension';\nttypes.META_TABLE_NAME = 'name';\nttypes.META_TABLE_DB = 'db';\nttypes.META_TABLE_LOCATION = 'location';\nttypes.META_TABLE_SERDE = 'serde';\nttypes.META_TABLE_PARTITION_COLUMNS = 'partition_columns';\nttypes.FILE_INPUT_FORMAT = 'file.inputformat';\nttypes.FILE_OUTPUT_FORMAT = 'file.outputformat';\nttypes.META_TABLE_STORAGE = 'storage_handler';\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/hive_service_types.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar ttypes = module.exports = {};\nttypes.JobTrackerState = {\n'INITIALIZING' : 1,\n'RUNNING' : 2\n};\nvar HiveClusterStatus = module.exports.HiveClusterStatus = function(args) {\n  this.taskTrackers = null;\n  this.mapTasks = null;\n  this.reduceTasks = null;\n  this.maxMapTasks = null;\n  this.maxReduceTasks = null;\n  this.state = null;\n  if (args) {\n    if (args.taskTrackers !== undefined) {\n      this.taskTrackers = args.taskTrackers;\n    }\n    if (args.mapTasks !== undefined) {\n      this.mapTasks = args.mapTasks;\n    }\n    if (args.reduceTasks !== undefined) {\n      this.reduceTasks = args.reduceTasks;\n    }\n    if (args.maxMapTasks !== undefined) {\n      this.maxMapTasks = args.maxMapTasks;\n    }\n    if (args.maxReduceTasks !== undefined) {\n      this.maxReduceTasks = args.maxReduceTasks;\n    }\n    if (args.state !== undefined) {\n      this.state = args.state;\n    }\n  }\n};\nHiveClusterStatus.prototype = {};\nHiveClusterStatus.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.taskTrackers = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.mapTasks = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.reduceTasks = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.maxMapTasks = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.maxReduceTasks = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.I32) {\n        this.state = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nHiveClusterStatus.prototype.write = function(output) {\n  output.writeStructBegin('HiveClusterStatus');\n  if (this.taskTrackers) {\n    output.writeFieldBegin('taskTrackers', Thrift.Type.I32, 1);\n    output.writeI32(this.taskTrackers);\n    output.writeFieldEnd();\n  }\n  if (this.mapTasks) {\n    output.writeFieldBegin('mapTasks', Thrift.Type.I32, 2);\n    output.writeI32(this.mapTasks);\n    output.writeFieldEnd();\n  }\n  if (this.reduceTasks) {\n    output.writeFieldBegin('reduceTasks', Thrift.Type.I32, 3);\n    output.writeI32(this.reduceTasks);\n    output.writeFieldEnd();\n  }\n  if (this.maxMapTasks) {\n    output.writeFieldBegin('maxMapTasks', Thrift.Type.I32, 4);\n    output.writeI32(this.maxMapTasks);\n    output.writeFieldEnd();\n  }\n  if (this.maxReduceTasks) {\n    output.writeFieldBegin('maxReduceTasks', Thrift.Type.I32, 5);\n    output.writeI32(this.maxReduceTasks);\n    output.writeFieldEnd();\n  }\n  if (this.state) {\n    output.writeFieldBegin('state', Thrift.Type.I32, 6);\n    output.writeI32(this.state);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar HiveServerException = module.exports.HiveServerException = function(args) {\n  Thrift.TException.call(this, \"HiveServerException\")\n  this.name = \"HiveServerException\"\n  this.message = null;\n  this.errorCode = null;\n  this.SQLState = null;\n  if (args) {\n    if (args.message !== undefined) {\n      this.message = args.message;\n    }\n    if (args.errorCode !== undefined) {\n      this.errorCode = args.errorCode;\n    }\n    if (args.SQLState !== undefined) {\n      this.SQLState = args.SQLState;\n    }\n  }\n};\nThrift.inherits(HiveServerException, Thrift.TException);\nHiveServerException.prototype.name = 'HiveServerException';\nHiveServerException.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.message = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.errorCode = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.SQLState = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nHiveServerException.prototype.write = function(output) {\n  output.writeStructBegin('HiveServerException');\n  if (this.message) {\n    output.writeFieldBegin('message', Thrift.Type.STRING, 1);\n    output.writeString(this.message);\n    output.writeFieldEnd();\n  }\n  if (this.errorCode) {\n    output.writeFieldBegin('errorCode', Thrift.Type.I32, 2);\n    output.writeI32(this.errorCode);\n    output.writeFieldEnd();\n  }\n  if (this.SQLState) {\n    output.writeFieldBegin('SQLState', Thrift.Type.STRING, 3);\n    output.writeString(this.SQLState);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/index.js",
    "content": "var thrift = require('node-thrift'),\n    ttransport = require('node-thrift/lib/thrift/transport'),\n    ThriftHive = require('./ThriftHive');\n\nvar Executer = exports.Executer = function(conf, logger){\n  if (conf.name !== 'hiveserver')\n    throw \"executer name mismatch for hiveserver:\" + conf.name;\n\n  this.logger = logger;\n\n  this._connection = thrift.createConnection(\n    conf.host,\n    conf.port,\n    {transport: ttransport.TBufferedTransport}\n  );\n  this._client = thrift.createClient(ThriftHive, this._connection);\n};\n\nExecuter.prototype.end = function(){\n  if (this._client) {\n    var self = this;\n    this._client.clean(function(){\n        self._connection.end();\n    });\n  }\n};\n\nExecuter.prototype.supports = function(operation){\n  switch (operation) {\n  case 'jobname':\n  case 'setup':\n  case 'databases':\n  case 'tables':\n  case 'partitions':\n  case 'describe':\n  case 'execute':\n    return true;\n  }\n  throw \"unknown operation name (for hiveserver.Executer):\" + operation;\n};\n\nExecuter.prototype.jobname = function(queryid){\n  return 'shib-hs1-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  if (!setups || setups.length < 1) {\n    callback(null); return;\n  }\n\n  var client = this._client;\n  var setupQueue = setups.concat(); // shallow copy of Array to use as queue\n  var executeSetup = function(queue, callback){\n    var q = queue.shift();\n    client.execute(q, function(err){\n      if (err)\n        callback(err);\n      else\n        client.fetchAll(function(err, data){\n          if (queue.length > 0)\n            executeSetup(queue, callback);\n          else\n            callback(null);\n        });\n    });\n  };\n  executeSetup(setupQueue, callback);\n};\n\nExecuter.prototype.databases = function(callback){\n  var client = this._client;\n  client.execute('show databases', function(err){\n    if (err)\n      callback(err);\n    else\n      client.fetchAll(function(err, data){\n        if (err) { callback(err); return; }\n        callback(null, data);\n      });\n  });\n};\n\nExecuter.prototype.tables = function(dbname, callback){\n  var client = this._client;\n  this.setup(['use ' + dbname], function(err){\n    if (err) { callback(err); return; }\n    client.execute('show tables', function(err){\n      if (err)\n        callback(err);\n      else\n        client.fetchAll(function(err, data){\n          if (err) { callback(err); return; }\n          callback(null, data);\n        });\n    });\n  });\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  var client = this._client;\n  this.setup(['use ' + dbname], function(err){\n    if (err) { callback(err); return; }\n    client.execute('show partitions ' + tablename, function(err){\n      if (err) {\n        callback(err);\n        return;\n      }\n      client.fetchAll(function(err, data){\n        callback(err, data);\n      });\n    });\n  });\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  var client = this._client;\n  this.setup(['use ' + dbname], function(err){\n    if (err) { callback(err); return; }\n    client.execute('describe ' + tablename, function(err){\n      if (err)\n        callback(err);\n      else\n        client.fetchAll(function(err, data){\n          if (err) { callback(err); return; }\n          var rows = data.map(function(row){ return row.split('\\t'); });\n          callback(null, rows);\n        });\n    });\n  });\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  var client = this._client;\n\n  var settings = [];\n  if (dbname)\n    settings.push('use ' + dbname);\n  if (jobname && jobname !== '') {\n    settings.push('set mapred.job.name=' + jobname);\n    settings.push('set mapreduce.job.name=' + jobname);\n  }\n  this.setup(settings, function(err){\n    if (err) { callback(err); return; }\n\n    client.execute(query, function(err){\n      if (err) {\n        callback(err); return;\n      }\n      callback(null, new Fetcher(client));\n    });\n  });\n};\n\nvar Fetcher = function(client){\n  this._client = client;\n\n  this.schema = function(callback){\n    this._client.getSchema(function(err, data){\n      if (err) { callback(err); return; }\n      callback(null, data.fieldSchemas);\n    });\n  };\n\n  this.fetch = function(num, callback){\n    if (!num) {\n      this._client.fetchAll(callback);\n    } else {\n      this._client.fetchN(num, callback);\n    }\n  };\n};\n\n// has no Monitor\n"
  },
  {
    "path": "lib/shib/engines/hiveserver/queryplan_types.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.8.0)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\nvar ttypes = module.exports = {};\nttypes.AdjacencyType = {\n'CONJUNCTIVE' : 0,\n'DISJUNCTIVE' : 1\n};\nttypes.NodeType = {\n'OPERATOR' : 0,\n'STAGE' : 1\n};\nttypes.OperatorType = {\n'JOIN' : 0,\n'MAPJOIN' : 1,\n'EXTRACT' : 2,\n'FILTER' : 3,\n'FORWARD' : 4,\n'GROUPBY' : 5,\n'LIMIT' : 6,\n'SCRIPT' : 7,\n'SELECT' : 8,\n'TABLESCAN' : 9,\n'FILESINK' : 10,\n'REDUCESINK' : 11,\n'UNION' : 12,\n'UDTF' : 13,\n'LATERALVIEWJOIN' : 14,\n'LATERALVIEWFORWARD' : 15,\n'HASHTABLESINK' : 16,\n'HASHTABLEDUMMY' : 17\n};\nttypes.TaskType = {\n'MAP' : 0,\n'REDUCE' : 1,\n'OTHER' : 2\n};\nttypes.StageType = {\n'CONDITIONAL' : 0,\n'COPY' : 1,\n'DDL' : 2,\n'MAPRED' : 3,\n'EXPLAIN' : 4,\n'FETCH' : 5,\n'FUNC' : 6,\n'MAPREDLOCAL' : 7,\n'MOVE' : 8,\n'STATS' : 9\n};\nvar Adjacency = module.exports.Adjacency = function(args) {\n  this.node = null;\n  this.children = null;\n  this.adjacencyType = null;\n  if (args) {\n    if (args.node !== undefined) {\n      this.node = args.node;\n    }\n    if (args.children !== undefined) {\n      this.children = args.children;\n    }\n    if (args.adjacencyType !== undefined) {\n      this.adjacencyType = args.adjacencyType;\n    }\n  }\n};\nAdjacency.prototype = {};\nAdjacency.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.node = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.LIST) {\n        var _size0 = 0;\n        var _rtmp34;\n        this.children = [];\n        var _etype3 = 0;\n        _rtmp34 = input.readListBegin();\n        _etype3 = _rtmp34.etype;\n        _size0 = _rtmp34.size;\n        for (var _i5 = 0; _i5 < _size0; ++_i5)\n        {\n          var elem6 = null;\n          elem6 = input.readString();\n          this.children.push(elem6);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.adjacencyType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nAdjacency.prototype.write = function(output) {\n  output.writeStructBegin('Adjacency');\n  if (this.node) {\n    output.writeFieldBegin('node', Thrift.Type.STRING, 1);\n    output.writeString(this.node);\n    output.writeFieldEnd();\n  }\n  if (this.children) {\n    output.writeFieldBegin('children', Thrift.Type.LIST, 2);\n    output.writeListBegin(Thrift.Type.STRING, this.children.length);\n    for (var iter7 in this.children)\n    {\n      if (this.children.hasOwnProperty(iter7))\n      {\n        iter7 = this.children[iter7];\n        output.writeString(iter7);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.adjacencyType) {\n    output.writeFieldBegin('adjacencyType', Thrift.Type.I32, 3);\n    output.writeI32(this.adjacencyType);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Graph = module.exports.Graph = function(args) {\n  this.nodeType = null;\n  this.roots = null;\n  this.adjacencyList = null;\n  if (args) {\n    if (args.nodeType !== undefined) {\n      this.nodeType = args.nodeType;\n    }\n    if (args.roots !== undefined) {\n      this.roots = args.roots;\n    }\n    if (args.adjacencyList !== undefined) {\n      this.adjacencyList = args.adjacencyList;\n    }\n  }\n};\nGraph.prototype = {};\nGraph.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.nodeType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.LIST) {\n        var _size8 = 0;\n        var _rtmp312;\n        this.roots = [];\n        var _etype11 = 0;\n        _rtmp312 = input.readListBegin();\n        _etype11 = _rtmp312.etype;\n        _size8 = _rtmp312.size;\n        for (var _i13 = 0; _i13 < _size8; ++_i13)\n        {\n          var elem14 = null;\n          elem14 = input.readString();\n          this.roots.push(elem14);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size15 = 0;\n        var _rtmp319;\n        this.adjacencyList = [];\n        var _etype18 = 0;\n        _rtmp319 = input.readListBegin();\n        _etype18 = _rtmp319.etype;\n        _size15 = _rtmp319.size;\n        for (var _i20 = 0; _i20 < _size15; ++_i20)\n        {\n          var elem21 = null;\n          elem21 = new ttypes.Adjacency();\n          elem21.read(input);\n          this.adjacencyList.push(elem21);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nGraph.prototype.write = function(output) {\n  output.writeStructBegin('Graph');\n  if (this.nodeType) {\n    output.writeFieldBegin('nodeType', Thrift.Type.I32, 1);\n    output.writeI32(this.nodeType);\n    output.writeFieldEnd();\n  }\n  if (this.roots) {\n    output.writeFieldBegin('roots', Thrift.Type.LIST, 2);\n    output.writeListBegin(Thrift.Type.STRING, this.roots.length);\n    for (var iter22 in this.roots)\n    {\n      if (this.roots.hasOwnProperty(iter22))\n      {\n        iter22 = this.roots[iter22];\n        output.writeString(iter22);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.adjacencyList) {\n    output.writeFieldBegin('adjacencyList', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRUCT, this.adjacencyList.length);\n    for (var iter23 in this.adjacencyList)\n    {\n      if (this.adjacencyList.hasOwnProperty(iter23))\n      {\n        iter23 = this.adjacencyList[iter23];\n        iter23.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Operator = module.exports.Operator = function(args) {\n  this.operatorId = null;\n  this.operatorType = null;\n  this.operatorAttributes = null;\n  this.operatorCounters = null;\n  this.done = null;\n  this.started = null;\n  if (args) {\n    if (args.operatorId !== undefined) {\n      this.operatorId = args.operatorId;\n    }\n    if (args.operatorType !== undefined) {\n      this.operatorType = args.operatorType;\n    }\n    if (args.operatorAttributes !== undefined) {\n      this.operatorAttributes = args.operatorAttributes;\n    }\n    if (args.operatorCounters !== undefined) {\n      this.operatorCounters = args.operatorCounters;\n    }\n    if (args.done !== undefined) {\n      this.done = args.done;\n    }\n    if (args.started !== undefined) {\n      this.started = args.started;\n    }\n  }\n};\nOperator.prototype = {};\nOperator.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.operatorId = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.operatorType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size24 = 0;\n        var _rtmp328;\n        this.operatorAttributes = {};\n        var _ktype25 = 0;\n        var _vtype26 = 0;\n        _rtmp328 = input.readMapBegin();\n        _ktype25 = _rtmp328.ktype;\n        _vtype26 = _rtmp328.vtype;\n        _size24 = _rtmp328.size;\n        for (var _i29 = 0; _i29 < _size24; ++_i29)\n        {\n          if (_i29 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key30 = null;\n          var val31 = null;\n          key30 = input.readString();\n          val31 = input.readString();\n          this.operatorAttributes[key30] = val31;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size32 = 0;\n        var _rtmp336;\n        this.operatorCounters = {};\n        var _ktype33 = 0;\n        var _vtype34 = 0;\n        _rtmp336 = input.readMapBegin();\n        _ktype33 = _rtmp336.ktype;\n        _vtype34 = _rtmp336.vtype;\n        _size32 = _rtmp336.size;\n        for (var _i37 = 0; _i37 < _size32; ++_i37)\n        {\n          if (_i37 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key38 = null;\n          var val39 = null;\n          key38 = input.readString();\n          val39 = input.readI64();\n          this.operatorCounters[key38] = val39;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.BOOL) {\n        this.done = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.BOOL) {\n        this.started = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nOperator.prototype.write = function(output) {\n  output.writeStructBegin('Operator');\n  if (this.operatorId) {\n    output.writeFieldBegin('operatorId', Thrift.Type.STRING, 1);\n    output.writeString(this.operatorId);\n    output.writeFieldEnd();\n  }\n  if (this.operatorType) {\n    output.writeFieldBegin('operatorType', Thrift.Type.I32, 2);\n    output.writeI32(this.operatorType);\n    output.writeFieldEnd();\n  }\n  if (this.operatorAttributes) {\n    output.writeFieldBegin('operatorAttributes', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.operatorAttributes));\n    for (var kiter40 in this.operatorAttributes)\n    {\n      if (this.operatorAttributes.hasOwnProperty(kiter40))\n      {\n        var viter41 = this.operatorAttributes[kiter40];\n        output.writeString(kiter40);\n        output.writeString(viter41);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.operatorCounters) {\n    output.writeFieldBegin('operatorCounters', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.operatorCounters));\n    for (var kiter42 in this.operatorCounters)\n    {\n      if (this.operatorCounters.hasOwnProperty(kiter42))\n      {\n        var viter43 = this.operatorCounters[kiter42];\n        output.writeString(kiter42);\n        output.writeI64(viter43);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.done) {\n    output.writeFieldBegin('done', Thrift.Type.BOOL, 5);\n    output.writeBool(this.done);\n    output.writeFieldEnd();\n  }\n  if (this.started) {\n    output.writeFieldBegin('started', Thrift.Type.BOOL, 6);\n    output.writeBool(this.started);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Task = module.exports.Task = function(args) {\n  this.taskId = null;\n  this.taskType = null;\n  this.taskAttributes = null;\n  this.taskCounters = null;\n  this.operatorGraph = null;\n  this.operatorList = null;\n  this.done = null;\n  this.started = null;\n  if (args) {\n    if (args.taskId !== undefined) {\n      this.taskId = args.taskId;\n    }\n    if (args.taskType !== undefined) {\n      this.taskType = args.taskType;\n    }\n    if (args.taskAttributes !== undefined) {\n      this.taskAttributes = args.taskAttributes;\n    }\n    if (args.taskCounters !== undefined) {\n      this.taskCounters = args.taskCounters;\n    }\n    if (args.operatorGraph !== undefined) {\n      this.operatorGraph = args.operatorGraph;\n    }\n    if (args.operatorList !== undefined) {\n      this.operatorList = args.operatorList;\n    }\n    if (args.done !== undefined) {\n      this.done = args.done;\n    }\n    if (args.started !== undefined) {\n      this.started = args.started;\n    }\n  }\n};\nTask.prototype = {};\nTask.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.taskId = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.taskType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size44 = 0;\n        var _rtmp348;\n        this.taskAttributes = {};\n        var _ktype45 = 0;\n        var _vtype46 = 0;\n        _rtmp348 = input.readMapBegin();\n        _ktype45 = _rtmp348.ktype;\n        _vtype46 = _rtmp348.vtype;\n        _size44 = _rtmp348.size;\n        for (var _i49 = 0; _i49 < _size44; ++_i49)\n        {\n          if (_i49 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key50 = null;\n          var val51 = null;\n          key50 = input.readString();\n          val51 = input.readString();\n          this.taskAttributes[key50] = val51;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size52 = 0;\n        var _rtmp356;\n        this.taskCounters = {};\n        var _ktype53 = 0;\n        var _vtype54 = 0;\n        _rtmp356 = input.readMapBegin();\n        _ktype53 = _rtmp356.ktype;\n        _vtype54 = _rtmp356.vtype;\n        _size52 = _rtmp356.size;\n        for (var _i57 = 0; _i57 < _size52; ++_i57)\n        {\n          if (_i57 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key58 = null;\n          var val59 = null;\n          key58 = input.readString();\n          val59 = input.readI64();\n          this.taskCounters[key58] = val59;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operatorGraph = new ttypes.Graph();\n        this.operatorGraph.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.LIST) {\n        var _size60 = 0;\n        var _rtmp364;\n        this.operatorList = [];\n        var _etype63 = 0;\n        _rtmp364 = input.readListBegin();\n        _etype63 = _rtmp364.etype;\n        _size60 = _rtmp364.size;\n        for (var _i65 = 0; _i65 < _size60; ++_i65)\n        {\n          var elem66 = null;\n          elem66 = new ttypes.Operator();\n          elem66.read(input);\n          this.operatorList.push(elem66);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.BOOL) {\n        this.done = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.BOOL) {\n        this.started = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTask.prototype.write = function(output) {\n  output.writeStructBegin('Task');\n  if (this.taskId) {\n    output.writeFieldBegin('taskId', Thrift.Type.STRING, 1);\n    output.writeString(this.taskId);\n    output.writeFieldEnd();\n  }\n  if (this.taskType) {\n    output.writeFieldBegin('taskType', Thrift.Type.I32, 2);\n    output.writeI32(this.taskType);\n    output.writeFieldEnd();\n  }\n  if (this.taskAttributes) {\n    output.writeFieldBegin('taskAttributes', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.taskAttributes));\n    for (var kiter67 in this.taskAttributes)\n    {\n      if (this.taskAttributes.hasOwnProperty(kiter67))\n      {\n        var viter68 = this.taskAttributes[kiter67];\n        output.writeString(kiter67);\n        output.writeString(viter68);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.taskCounters) {\n    output.writeFieldBegin('taskCounters', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.taskCounters));\n    for (var kiter69 in this.taskCounters)\n    {\n      if (this.taskCounters.hasOwnProperty(kiter69))\n      {\n        var viter70 = this.taskCounters[kiter69];\n        output.writeString(kiter69);\n        output.writeI64(viter70);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.operatorGraph) {\n    output.writeFieldBegin('operatorGraph', Thrift.Type.STRUCT, 5);\n    this.operatorGraph.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operatorList) {\n    output.writeFieldBegin('operatorList', Thrift.Type.LIST, 6);\n    output.writeListBegin(Thrift.Type.STRUCT, this.operatorList.length);\n    for (var iter71 in this.operatorList)\n    {\n      if (this.operatorList.hasOwnProperty(iter71))\n      {\n        iter71 = this.operatorList[iter71];\n        iter71.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.done) {\n    output.writeFieldBegin('done', Thrift.Type.BOOL, 7);\n    output.writeBool(this.done);\n    output.writeFieldEnd();\n  }\n  if (this.started) {\n    output.writeFieldBegin('started', Thrift.Type.BOOL, 8);\n    output.writeBool(this.started);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Stage = module.exports.Stage = function(args) {\n  this.stageId = null;\n  this.stageType = null;\n  this.stageAttributes = null;\n  this.stageCounters = null;\n  this.taskList = null;\n  this.done = null;\n  this.started = null;\n  if (args) {\n    if (args.stageId !== undefined) {\n      this.stageId = args.stageId;\n    }\n    if (args.stageType !== undefined) {\n      this.stageType = args.stageType;\n    }\n    if (args.stageAttributes !== undefined) {\n      this.stageAttributes = args.stageAttributes;\n    }\n    if (args.stageCounters !== undefined) {\n      this.stageCounters = args.stageCounters;\n    }\n    if (args.taskList !== undefined) {\n      this.taskList = args.taskList;\n    }\n    if (args.done !== undefined) {\n      this.done = args.done;\n    }\n    if (args.started !== undefined) {\n      this.started = args.started;\n    }\n  }\n};\nStage.prototype = {};\nStage.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.stageId = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.stageType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size72 = 0;\n        var _rtmp376;\n        this.stageAttributes = {};\n        var _ktype73 = 0;\n        var _vtype74 = 0;\n        _rtmp376 = input.readMapBegin();\n        _ktype73 = _rtmp376.ktype;\n        _vtype74 = _rtmp376.vtype;\n        _size72 = _rtmp376.size;\n        for (var _i77 = 0; _i77 < _size72; ++_i77)\n        {\n          if (_i77 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key78 = null;\n          var val79 = null;\n          key78 = input.readString();\n          val79 = input.readString();\n          this.stageAttributes[key78] = val79;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size80 = 0;\n        var _rtmp384;\n        this.stageCounters = {};\n        var _ktype81 = 0;\n        var _vtype82 = 0;\n        _rtmp384 = input.readMapBegin();\n        _ktype81 = _rtmp384.ktype;\n        _vtype82 = _rtmp384.vtype;\n        _size80 = _rtmp384.size;\n        for (var _i85 = 0; _i85 < _size80; ++_i85)\n        {\n          if (_i85 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key86 = null;\n          var val87 = null;\n          key86 = input.readString();\n          val87 = input.readI64();\n          this.stageCounters[key86] = val87;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.LIST) {\n        var _size88 = 0;\n        var _rtmp392;\n        this.taskList = [];\n        var _etype91 = 0;\n        _rtmp392 = input.readListBegin();\n        _etype91 = _rtmp392.etype;\n        _size88 = _rtmp392.size;\n        for (var _i93 = 0; _i93 < _size88; ++_i93)\n        {\n          var elem94 = null;\n          elem94 = new ttypes.Task();\n          elem94.read(input);\n          this.taskList.push(elem94);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.BOOL) {\n        this.done = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.BOOL) {\n        this.started = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nStage.prototype.write = function(output) {\n  output.writeStructBegin('Stage');\n  if (this.stageId) {\n    output.writeFieldBegin('stageId', Thrift.Type.STRING, 1);\n    output.writeString(this.stageId);\n    output.writeFieldEnd();\n  }\n  if (this.stageType) {\n    output.writeFieldBegin('stageType', Thrift.Type.I32, 2);\n    output.writeI32(this.stageType);\n    output.writeFieldEnd();\n  }\n  if (this.stageAttributes) {\n    output.writeFieldBegin('stageAttributes', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.stageAttributes));\n    for (var kiter95 in this.stageAttributes)\n    {\n      if (this.stageAttributes.hasOwnProperty(kiter95))\n      {\n        var viter96 = this.stageAttributes[kiter95];\n        output.writeString(kiter95);\n        output.writeString(viter96);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.stageCounters) {\n    output.writeFieldBegin('stageCounters', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.stageCounters));\n    for (var kiter97 in this.stageCounters)\n    {\n      if (this.stageCounters.hasOwnProperty(kiter97))\n      {\n        var viter98 = this.stageCounters[kiter97];\n        output.writeString(kiter97);\n        output.writeI64(viter98);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.taskList) {\n    output.writeFieldBegin('taskList', Thrift.Type.LIST, 5);\n    output.writeListBegin(Thrift.Type.STRUCT, this.taskList.length);\n    for (var iter99 in this.taskList)\n    {\n      if (this.taskList.hasOwnProperty(iter99))\n      {\n        iter99 = this.taskList[iter99];\n        iter99.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.done) {\n    output.writeFieldBegin('done', Thrift.Type.BOOL, 6);\n    output.writeBool(this.done);\n    output.writeFieldEnd();\n  }\n  if (this.started) {\n    output.writeFieldBegin('started', Thrift.Type.BOOL, 7);\n    output.writeBool(this.started);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar Query = module.exports.Query = function(args) {\n  this.queryId = null;\n  this.queryType = null;\n  this.queryAttributes = null;\n  this.queryCounters = null;\n  this.stageGraph = null;\n  this.stageList = null;\n  this.done = null;\n  this.started = null;\n  if (args) {\n    if (args.queryId !== undefined) {\n      this.queryId = args.queryId;\n    }\n    if (args.queryType !== undefined) {\n      this.queryType = args.queryType;\n    }\n    if (args.queryAttributes !== undefined) {\n      this.queryAttributes = args.queryAttributes;\n    }\n    if (args.queryCounters !== undefined) {\n      this.queryCounters = args.queryCounters;\n    }\n    if (args.stageGraph !== undefined) {\n      this.stageGraph = args.stageGraph;\n    }\n    if (args.stageList !== undefined) {\n      this.stageList = args.stageList;\n    }\n    if (args.done !== undefined) {\n      this.done = args.done;\n    }\n    if (args.started !== undefined) {\n      this.started = args.started;\n    }\n  }\n};\nQuery.prototype = {};\nQuery.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.queryId = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.queryType = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size100 = 0;\n        var _rtmp3104;\n        this.queryAttributes = {};\n        var _ktype101 = 0;\n        var _vtype102 = 0;\n        _rtmp3104 = input.readMapBegin();\n        _ktype101 = _rtmp3104.ktype;\n        _vtype102 = _rtmp3104.vtype;\n        _size100 = _rtmp3104.size;\n        for (var _i105 = 0; _i105 < _size100; ++_i105)\n        {\n          if (_i105 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key106 = null;\n          var val107 = null;\n          key106 = input.readString();\n          val107 = input.readString();\n          this.queryAttributes[key106] = val107;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size108 = 0;\n        var _rtmp3112;\n        this.queryCounters = {};\n        var _ktype109 = 0;\n        var _vtype110 = 0;\n        _rtmp3112 = input.readMapBegin();\n        _ktype109 = _rtmp3112.ktype;\n        _vtype110 = _rtmp3112.vtype;\n        _size108 = _rtmp3112.size;\n        for (var _i113 = 0; _i113 < _size108; ++_i113)\n        {\n          if (_i113 > 0 ) {\n            if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {\n              input.rstack.pop();\n            }\n          }\n          var key114 = null;\n          var val115 = null;\n          key114 = input.readString();\n          val115 = input.readI64();\n          this.queryCounters[key114] = val115;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.stageGraph = new ttypes.Graph();\n        this.stageGraph.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.LIST) {\n        var _size116 = 0;\n        var _rtmp3120;\n        this.stageList = [];\n        var _etype119 = 0;\n        _rtmp3120 = input.readListBegin();\n        _etype119 = _rtmp3120.etype;\n        _size116 = _rtmp3120.size;\n        for (var _i121 = 0; _i121 < _size116; ++_i121)\n        {\n          var elem122 = null;\n          elem122 = new ttypes.Stage();\n          elem122.read(input);\n          this.stageList.push(elem122);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.BOOL) {\n        this.done = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 8:\n      if (ftype == Thrift.Type.BOOL) {\n        this.started = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nQuery.prototype.write = function(output) {\n  output.writeStructBegin('Query');\n  if (this.queryId) {\n    output.writeFieldBegin('queryId', Thrift.Type.STRING, 1);\n    output.writeString(this.queryId);\n    output.writeFieldEnd();\n  }\n  if (this.queryType) {\n    output.writeFieldBegin('queryType', Thrift.Type.STRING, 2);\n    output.writeString(this.queryType);\n    output.writeFieldEnd();\n  }\n  if (this.queryAttributes) {\n    output.writeFieldBegin('queryAttributes', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.queryAttributes));\n    for (var kiter123 in this.queryAttributes)\n    {\n      if (this.queryAttributes.hasOwnProperty(kiter123))\n      {\n        var viter124 = this.queryAttributes[kiter123];\n        output.writeString(kiter123);\n        output.writeString(viter124);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.queryCounters) {\n    output.writeFieldBegin('queryCounters', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.queryCounters));\n    for (var kiter125 in this.queryCounters)\n    {\n      if (this.queryCounters.hasOwnProperty(kiter125))\n      {\n        var viter126 = this.queryCounters[kiter125];\n        output.writeString(kiter125);\n        output.writeI64(viter126);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  if (this.stageGraph) {\n    output.writeFieldBegin('stageGraph', Thrift.Type.STRUCT, 5);\n    this.stageGraph.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.stageList) {\n    output.writeFieldBegin('stageList', Thrift.Type.LIST, 6);\n    output.writeListBegin(Thrift.Type.STRUCT, this.stageList.length);\n    for (var iter127 in this.stageList)\n    {\n      if (this.stageList.hasOwnProperty(iter127))\n      {\n        iter127 = this.stageList[iter127];\n        iter127.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.done) {\n    output.writeFieldBegin('done', Thrift.Type.BOOL, 7);\n    output.writeBool(this.done);\n    output.writeFieldEnd();\n  }\n  if (this.started) {\n    output.writeFieldBegin('started', Thrift.Type.BOOL, 8);\n    output.writeBool(this.started);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar QueryPlan = module.exports.QueryPlan = function(args) {\n  this.queries = null;\n  this.done = null;\n  this.started = null;\n  if (args) {\n    if (args.queries !== undefined) {\n      this.queries = args.queries;\n    }\n    if (args.done !== undefined) {\n      this.done = args.done;\n    }\n    if (args.started !== undefined) {\n      this.started = args.started;\n    }\n  }\n};\nQueryPlan.prototype = {};\nQueryPlan.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size128 = 0;\n        var _rtmp3132;\n        this.queries = [];\n        var _etype131 = 0;\n        _rtmp3132 = input.readListBegin();\n        _etype131 = _rtmp3132.etype;\n        _size128 = _rtmp3132.size;\n        for (var _i133 = 0; _i133 < _size128; ++_i133)\n        {\n          var elem134 = null;\n          elem134 = new ttypes.Query();\n          elem134.read(input);\n          this.queries.push(elem134);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.BOOL) {\n        this.done = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.BOOL) {\n        this.started = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nQueryPlan.prototype.write = function(output) {\n  output.writeStructBegin('QueryPlan');\n  if (this.queries) {\n    output.writeFieldBegin('queries', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.queries.length);\n    for (var iter135 in this.queries)\n    {\n      if (this.queries.hasOwnProperty(iter135))\n      {\n        iter135 = this.queries[iter135];\n        iter135.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.done) {\n    output.writeFieldBegin('done', Thrift.Type.BOOL, 2);\n    output.writeBool(this.done);\n    output.writeFieldEnd();\n  }\n  if (this.started) {\n    output.writeFieldBegin('started', Thrift.Type.BOOL, 3);\n    output.writeBool(this.started);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver2/TCLIService.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.9.1)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\n\nvar ttypes = require('./TCLIService_types');\n//HELPER FUNCTIONS AND STRUCTURES\n\nvar TCLIService_OpenSession_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_OpenSession_args.prototype = {};\nTCLIService_OpenSession_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TOpenSessionReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_OpenSession_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_OpenSession_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_OpenSession_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_OpenSession_result.prototype = {};\nTCLIService_OpenSession_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TOpenSessionResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_OpenSession_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_OpenSession_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CloseSession_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_CloseSession_args.prototype = {};\nTCLIService_CloseSession_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TCloseSessionReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CloseSession_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CloseSession_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CloseSession_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_CloseSession_result.prototype = {};\nTCLIService_CloseSession_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TCloseSessionResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CloseSession_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CloseSession_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetInfo_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetInfo_args.prototype = {};\nTCLIService_GetInfo_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetInfoReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetInfo_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetInfo_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetInfo_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetInfo_result.prototype = {};\nTCLIService_GetInfo_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetInfoResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetInfo_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetInfo_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_ExecuteStatement_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_ExecuteStatement_args.prototype = {};\nTCLIService_ExecuteStatement_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TExecuteStatementReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_ExecuteStatement_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_ExecuteStatement_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_ExecuteStatement_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_ExecuteStatement_result.prototype = {};\nTCLIService_ExecuteStatement_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TExecuteStatementResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_ExecuteStatement_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_ExecuteStatement_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTypeInfo_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetTypeInfo_args.prototype = {};\nTCLIService_GetTypeInfo_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetTypeInfoReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTypeInfo_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTypeInfo_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTypeInfo_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetTypeInfo_result.prototype = {};\nTCLIService_GetTypeInfo_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetTypeInfoResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTypeInfo_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTypeInfo_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetCatalogs_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetCatalogs_args.prototype = {};\nTCLIService_GetCatalogs_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetCatalogsReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetCatalogs_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetCatalogs_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetCatalogs_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetCatalogs_result.prototype = {};\nTCLIService_GetCatalogs_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetCatalogsResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetCatalogs_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetCatalogs_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetSchemas_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetSchemas_args.prototype = {};\nTCLIService_GetSchemas_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetSchemasReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetSchemas_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetSchemas_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetSchemas_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetSchemas_result.prototype = {};\nTCLIService_GetSchemas_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetSchemasResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetSchemas_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetSchemas_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTables_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetTables_args.prototype = {};\nTCLIService_GetTables_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetTablesReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTables_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTables_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTables_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetTables_result.prototype = {};\nTCLIService_GetTables_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetTablesResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTables_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTables_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTableTypes_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetTableTypes_args.prototype = {};\nTCLIService_GetTableTypes_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetTableTypesReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTableTypes_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTableTypes_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetTableTypes_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetTableTypes_result.prototype = {};\nTCLIService_GetTableTypes_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetTableTypesResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetTableTypes_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetTableTypes_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetColumns_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetColumns_args.prototype = {};\nTCLIService_GetColumns_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetColumnsReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetColumns_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetColumns_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetColumns_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetColumns_result.prototype = {};\nTCLIService_GetColumns_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetColumnsResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetColumns_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetColumns_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetFunctions_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetFunctions_args.prototype = {};\nTCLIService_GetFunctions_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetFunctionsReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetFunctions_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetFunctions_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetFunctions_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetFunctions_result.prototype = {};\nTCLIService_GetFunctions_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetFunctionsResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetFunctions_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetFunctions_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetOperationStatus_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetOperationStatus_args.prototype = {};\nTCLIService_GetOperationStatus_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetOperationStatusReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetOperationStatus_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetOperationStatus_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetOperationStatus_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetOperationStatus_result.prototype = {};\nTCLIService_GetOperationStatus_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetOperationStatusResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetOperationStatus_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetOperationStatus_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CancelOperation_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_CancelOperation_args.prototype = {};\nTCLIService_CancelOperation_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TCancelOperationReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CancelOperation_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CancelOperation_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CancelOperation_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_CancelOperation_result.prototype = {};\nTCLIService_CancelOperation_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TCancelOperationResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CancelOperation_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CancelOperation_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CloseOperation_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_CloseOperation_args.prototype = {};\nTCLIService_CloseOperation_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TCloseOperationReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CloseOperation_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CloseOperation_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_CloseOperation_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_CloseOperation_result.prototype = {};\nTCLIService_CloseOperation_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TCloseOperationResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_CloseOperation_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_CloseOperation_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetResultSetMetadata_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_GetResultSetMetadata_args.prototype = {};\nTCLIService_GetResultSetMetadata_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TGetResultSetMetadataReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetResultSetMetadata_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetResultSetMetadata_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_GetResultSetMetadata_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_GetResultSetMetadata_result.prototype = {};\nTCLIService_GetResultSetMetadata_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TGetResultSetMetadataResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_GetResultSetMetadata_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_GetResultSetMetadata_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_FetchResults_args = function(args) {\n  this.req = null;\n  if (args) {\n    if (args.req !== undefined) {\n      this.req = args.req;\n    }\n  }\n};\nTCLIService_FetchResults_args.prototype = {};\nTCLIService_FetchResults_args.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.req = new ttypes.TFetchResultsReq();\n        this.req.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_FetchResults_args.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_FetchResults_args');\n  if (this.req !== null && this.req !== undefined) {\n    output.writeFieldBegin('req', Thrift.Type.STRUCT, 1);\n    this.req.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIService_FetchResults_result = function(args) {\n  this.success = null;\n  if (args) {\n    if (args.success !== undefined) {\n      this.success = args.success;\n    }\n  }\n};\nTCLIService_FetchResults_result.prototype = {};\nTCLIService_FetchResults_result.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 0:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.success = new ttypes.TFetchResultsResp();\n        this.success.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCLIService_FetchResults_result.prototype.write = function(output) {\n  output.writeStructBegin('TCLIService_FetchResults_result');\n  if (this.success !== null && this.success !== undefined) {\n    output.writeFieldBegin('success', Thrift.Type.STRUCT, 0);\n    this.success.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCLIServiceClient = exports.Client = function(output, pClass) {\n    this.output = output;\n    this.pClass = pClass;\n    this.seqid = 0;\n    this._reqs = {};\n};\nTCLIServiceClient.prototype = {};\nTCLIServiceClient.prototype.OpenSession = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_OpenSession(req);\n};\n\nTCLIServiceClient.prototype.send_OpenSession = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('OpenSession', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_OpenSession_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_OpenSession = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_OpenSession_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('OpenSession failed: unknown result');\n};\nTCLIServiceClient.prototype.CloseSession = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_CloseSession(req);\n};\n\nTCLIServiceClient.prototype.send_CloseSession = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('CloseSession', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_CloseSession_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_CloseSession = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_CloseSession_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('CloseSession failed: unknown result');\n};\nTCLIServiceClient.prototype.GetInfo = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetInfo(req);\n};\n\nTCLIServiceClient.prototype.send_GetInfo = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetInfo', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetInfo_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetInfo = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetInfo_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetInfo failed: unknown result');\n};\nTCLIServiceClient.prototype.ExecuteStatement = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_ExecuteStatement(req);\n};\n\nTCLIServiceClient.prototype.send_ExecuteStatement = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('ExecuteStatement', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_ExecuteStatement_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_ExecuteStatement = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_ExecuteStatement_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('ExecuteStatement failed: unknown result');\n};\nTCLIServiceClient.prototype.GetTypeInfo = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetTypeInfo(req);\n};\n\nTCLIServiceClient.prototype.send_GetTypeInfo = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetTypeInfo', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetTypeInfo_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetTypeInfo = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetTypeInfo_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetTypeInfo failed: unknown result');\n};\nTCLIServiceClient.prototype.GetCatalogs = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetCatalogs(req);\n};\n\nTCLIServiceClient.prototype.send_GetCatalogs = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetCatalogs', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetCatalogs_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetCatalogs = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetCatalogs_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetCatalogs failed: unknown result');\n};\nTCLIServiceClient.prototype.GetSchemas = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetSchemas(req);\n};\n\nTCLIServiceClient.prototype.send_GetSchemas = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetSchemas', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetSchemas_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetSchemas = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetSchemas_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetSchemas failed: unknown result');\n};\nTCLIServiceClient.prototype.GetTables = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetTables(req);\n};\n\nTCLIServiceClient.prototype.send_GetTables = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetTables', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetTables_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetTables = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetTables_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetTables failed: unknown result');\n};\nTCLIServiceClient.prototype.GetTableTypes = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetTableTypes(req);\n};\n\nTCLIServiceClient.prototype.send_GetTableTypes = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetTableTypes', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetTableTypes_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetTableTypes = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetTableTypes_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetTableTypes failed: unknown result');\n};\nTCLIServiceClient.prototype.GetColumns = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetColumns(req);\n};\n\nTCLIServiceClient.prototype.send_GetColumns = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetColumns', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetColumns_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetColumns = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetColumns_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetColumns failed: unknown result');\n};\nTCLIServiceClient.prototype.GetFunctions = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetFunctions(req);\n};\n\nTCLIServiceClient.prototype.send_GetFunctions = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetFunctions', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetFunctions_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetFunctions = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetFunctions_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetFunctions failed: unknown result');\n};\nTCLIServiceClient.prototype.GetOperationStatus = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetOperationStatus(req);\n};\n\nTCLIServiceClient.prototype.send_GetOperationStatus = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetOperationStatus', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetOperationStatus_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetOperationStatus = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetOperationStatus_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetOperationStatus failed: unknown result');\n};\nTCLIServiceClient.prototype.CancelOperation = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_CancelOperation(req);\n};\n\nTCLIServiceClient.prototype.send_CancelOperation = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('CancelOperation', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_CancelOperation_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_CancelOperation = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_CancelOperation_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('CancelOperation failed: unknown result');\n};\nTCLIServiceClient.prototype.CloseOperation = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_CloseOperation(req);\n};\n\nTCLIServiceClient.prototype.send_CloseOperation = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('CloseOperation', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_CloseOperation_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_CloseOperation = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_CloseOperation_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('CloseOperation failed: unknown result');\n};\nTCLIServiceClient.prototype.GetResultSetMetadata = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_GetResultSetMetadata(req);\n};\n\nTCLIServiceClient.prototype.send_GetResultSetMetadata = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('GetResultSetMetadata', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_GetResultSetMetadata_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_GetResultSetMetadata = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_GetResultSetMetadata_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('GetResultSetMetadata failed: unknown result');\n};\nTCLIServiceClient.prototype.FetchResults = function(req, callback) {\n  this.seqid += 1;\n  this._reqs[this.seqid] = callback;\n  this.send_FetchResults(req);\n};\n\nTCLIServiceClient.prototype.send_FetchResults = function(req) {\n  var output = new this.pClass(this.output);\n  output.writeMessageBegin('FetchResults', Thrift.MessageType.CALL, this.seqid);\n  var args = new TCLIService_FetchResults_args();\n  args.req = req;\n  args.write(output);\n  output.writeMessageEnd();\n  return this.output.flush();\n};\n\nTCLIServiceClient.prototype.recv_FetchResults = function(input,mtype,rseqid) {\n  var callback = this._reqs[rseqid] || function() {};\n  delete this._reqs[rseqid];\n  if (mtype == Thrift.MessageType.EXCEPTION) {\n    var x = new Thrift.TApplicationException();\n    x.read(input);\n    input.readMessageEnd();\n    return callback(x);\n  }\n  var result = new TCLIService_FetchResults_result();\n  result.read(input);\n  input.readMessageEnd();\n\n  if (null !== result.success) {\n    return callback(null, result.success);\n  }\n  return callback('FetchResults failed: unknown result');\n};\nvar TCLIServiceProcessor = exports.Processor = function(handler) {\n  this._handler = handler\n}\nTCLIServiceProcessor.prototype.process = function(input, output) {\n  var r = input.readMessageBegin();\n  if (this['process_' + r.fname]) {\n    return this['process_' + r.fname].call(this, r.rseqid, input, output);\n  } else {\n    input.skip(Thrift.Type.STRUCT);\n    input.readMessageEnd();\n    var x = new Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, 'Unknown function ' + r.fname);\n    output.writeMessageBegin(r.fname, Thrift.MessageType.Exception, r.rseqid);\n    x.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  }\n}\n\nTCLIServiceProcessor.prototype.process_OpenSession = function(seqid, input, output) {\n  var args = new TCLIService_OpenSession_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.OpenSession(args.req, function (err, result) {\n    var result = new TCLIService_OpenSession_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"OpenSession\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_CloseSession = function(seqid, input, output) {\n  var args = new TCLIService_CloseSession_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.CloseSession(args.req, function (err, result) {\n    var result = new TCLIService_CloseSession_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"CloseSession\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetInfo = function(seqid, input, output) {\n  var args = new TCLIService_GetInfo_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetInfo(args.req, function (err, result) {\n    var result = new TCLIService_GetInfo_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetInfo\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_ExecuteStatement = function(seqid, input, output) {\n  var args = new TCLIService_ExecuteStatement_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.ExecuteStatement(args.req, function (err, result) {\n    var result = new TCLIService_ExecuteStatement_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"ExecuteStatement\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetTypeInfo = function(seqid, input, output) {\n  var args = new TCLIService_GetTypeInfo_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetTypeInfo(args.req, function (err, result) {\n    var result = new TCLIService_GetTypeInfo_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetTypeInfo\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetCatalogs = function(seqid, input, output) {\n  var args = new TCLIService_GetCatalogs_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetCatalogs(args.req, function (err, result) {\n    var result = new TCLIService_GetCatalogs_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetCatalogs\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetSchemas = function(seqid, input, output) {\n  var args = new TCLIService_GetSchemas_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetSchemas(args.req, function (err, result) {\n    var result = new TCLIService_GetSchemas_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetSchemas\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetTables = function(seqid, input, output) {\n  var args = new TCLIService_GetTables_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetTables(args.req, function (err, result) {\n    var result = new TCLIService_GetTables_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetTables\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetTableTypes = function(seqid, input, output) {\n  var args = new TCLIService_GetTableTypes_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetTableTypes(args.req, function (err, result) {\n    var result = new TCLIService_GetTableTypes_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetTableTypes\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetColumns = function(seqid, input, output) {\n  var args = new TCLIService_GetColumns_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetColumns(args.req, function (err, result) {\n    var result = new TCLIService_GetColumns_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetColumns\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetFunctions = function(seqid, input, output) {\n  var args = new TCLIService_GetFunctions_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetFunctions(args.req, function (err, result) {\n    var result = new TCLIService_GetFunctions_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetFunctions\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetOperationStatus = function(seqid, input, output) {\n  var args = new TCLIService_GetOperationStatus_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetOperationStatus(args.req, function (err, result) {\n    var result = new TCLIService_GetOperationStatus_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetOperationStatus\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_CancelOperation = function(seqid, input, output) {\n  var args = new TCLIService_CancelOperation_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.CancelOperation(args.req, function (err, result) {\n    var result = new TCLIService_CancelOperation_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"CancelOperation\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_CloseOperation = function(seqid, input, output) {\n  var args = new TCLIService_CloseOperation_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.CloseOperation(args.req, function (err, result) {\n    var result = new TCLIService_CloseOperation_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"CloseOperation\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_GetResultSetMetadata = function(seqid, input, output) {\n  var args = new TCLIService_GetResultSetMetadata_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.GetResultSetMetadata(args.req, function (err, result) {\n    var result = new TCLIService_GetResultSetMetadata_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"GetResultSetMetadata\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\nTCLIServiceProcessor.prototype.process_FetchResults = function(seqid, input, output) {\n  var args = new TCLIService_FetchResults_args();\n  args.read(input);\n  input.readMessageEnd();\n  this._handler.FetchResults(args.req, function (err, result) {\n    var result = new TCLIService_FetchResults_result((err != null ? err : {success: result}));\n    output.writeMessageBegin(\"FetchResults\", Thrift.MessageType.REPLY, seqid);\n    result.write(output);\n    output.writeMessageEnd();\n    output.flush();\n  })\n}\n\n"
  },
  {
    "path": "lib/shib/engines/hiveserver2/TCLIService_types.js",
    "content": "//\n// Autogenerated by Thrift Compiler (0.9.1)\n//\n// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n//\nvar Thrift = require('node-thrift').Thrift;\n\nvar ttypes = module.exports = {};\nttypes.TProtocolVersion = {\n'HIVE_CLI_SERVICE_PROTOCOL_V1' : 0\n};\nttypes.TTypeId = {\n'BOOLEAN_TYPE' : 0,\n'TINYINT_TYPE' : 1,\n'SMALLINT_TYPE' : 2,\n'INT_TYPE' : 3,\n'BIGINT_TYPE' : 4,\n'FLOAT_TYPE' : 5,\n'DOUBLE_TYPE' : 6,\n'STRING_TYPE' : 7,\n'TIMESTAMP_TYPE' : 8,\n'BINARY_TYPE' : 9,\n'ARRAY_TYPE' : 10,\n'MAP_TYPE' : 11,\n'STRUCT_TYPE' : 12,\n'UNION_TYPE' : 13,\n'USER_DEFINED_TYPE' : 14,\n'DECIMAL_TYPE' : 15\n};\nttypes.TStatusCode = {\n'SUCCESS_STATUS' : 0,\n'SUCCESS_WITH_INFO_STATUS' : 1,\n'STILL_EXECUTING_STATUS' : 2,\n'ERROR_STATUS' : 3,\n'INVALID_HANDLE_STATUS' : 4\n};\nttypes.TOperationState = {\n'INITIALIZED_STATE' : 0,\n'RUNNING_STATE' : 1,\n'FINISHED_STATE' : 2,\n'CANCELED_STATE' : 3,\n'CLOSED_STATE' : 4,\n'ERROR_STATE' : 5,\n'UKNOWN_STATE' : 6\n};\nttypes.TOperationType = {\n'EXECUTE_STATEMENT' : 0,\n'GET_TYPE_INFO' : 1,\n'GET_CATALOGS' : 2,\n'GET_SCHEMAS' : 3,\n'GET_TABLES' : 4,\n'GET_TABLE_TYPES' : 5,\n'GET_COLUMNS' : 6,\n'GET_FUNCTIONS' : 7,\n'UNKNOWN' : 8\n};\nttypes.TGetInfoType = {\n'CLI_MAX_DRIVER_CONNECTIONS' : 0,\n'CLI_MAX_CONCURRENT_ACTIVITIES' : 1,\n'CLI_DATA_SOURCE_NAME' : 2,\n'CLI_FETCH_DIRECTION' : 8,\n'CLI_SERVER_NAME' : 13,\n'CLI_SEARCH_PATTERN_ESCAPE' : 14,\n'CLI_DBMS_NAME' : 17,\n'CLI_DBMS_VER' : 18,\n'CLI_ACCESSIBLE_TABLES' : 19,\n'CLI_ACCESSIBLE_PROCEDURES' : 20,\n'CLI_CURSOR_COMMIT_BEHAVIOR' : 23,\n'CLI_DATA_SOURCE_READ_ONLY' : 25,\n'CLI_DEFAULT_TXN_ISOLATION' : 26,\n'CLI_IDENTIFIER_CASE' : 28,\n'CLI_IDENTIFIER_QUOTE_CHAR' : 29,\n'CLI_MAX_COLUMN_NAME_LEN' : 30,\n'CLI_MAX_CURSOR_NAME_LEN' : 31,\n'CLI_MAX_SCHEMA_NAME_LEN' : 32,\n'CLI_MAX_CATALOG_NAME_LEN' : 34,\n'CLI_MAX_TABLE_NAME_LEN' : 35,\n'CLI_SCROLL_CONCURRENCY' : 43,\n'CLI_TXN_CAPABLE' : 46,\n'CLI_USER_NAME' : 47,\n'CLI_TXN_ISOLATION_OPTION' : 72,\n'CLI_INTEGRITY' : 73,\n'CLI_GETDATA_EXTENSIONS' : 81,\n'CLI_NULL_COLLATION' : 85,\n'CLI_ALTER_TABLE' : 86,\n'CLI_ORDER_BY_COLUMNS_IN_SELECT' : 90,\n'CLI_SPECIAL_CHARACTERS' : 94,\n'CLI_MAX_COLUMNS_IN_GROUP_BY' : 97,\n'CLI_MAX_COLUMNS_IN_INDEX' : 98,\n'CLI_MAX_COLUMNS_IN_ORDER_BY' : 99,\n'CLI_MAX_COLUMNS_IN_SELECT' : 100,\n'CLI_MAX_COLUMNS_IN_TABLE' : 101,\n'CLI_MAX_INDEX_SIZE' : 102,\n'CLI_MAX_ROW_SIZE' : 104,\n'CLI_MAX_STATEMENT_LEN' : 105,\n'CLI_MAX_TABLES_IN_SELECT' : 106,\n'CLI_MAX_USER_NAME_LEN' : 107,\n'CLI_OJ_CAPABILITIES' : 115,\n'CLI_XOPEN_CLI_YEAR' : 10000,\n'CLI_CURSOR_SENSITIVITY' : 10001,\n'CLI_DESCRIBE_PARAMETER' : 10002,\n'CLI_CATALOG_NAME' : 10003,\n'CLI_COLLATION_SEQ' : 10004,\n'CLI_MAX_IDENTIFIER_LEN' : 10005\n};\nttypes.TFetchOrientation = {\n'FETCH_NEXT' : 0,\n'FETCH_PRIOR' : 1,\n'FETCH_RELATIVE' : 2,\n'FETCH_ABSOLUTE' : 3,\n'FETCH_FIRST' : 4,\n'FETCH_LAST' : 5\n};\nvar TPrimitiveTypeEntry = module.exports.TPrimitiveTypeEntry = function(args) {\n  this.type = null;\n  if (args) {\n    if (args.type !== undefined) {\n      this.type = args.type;\n    }\n  }\n};\nTPrimitiveTypeEntry.prototype = {};\nTPrimitiveTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.type = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTPrimitiveTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TPrimitiveTypeEntry');\n  if (this.type !== null && this.type !== undefined) {\n    output.writeFieldBegin('type', Thrift.Type.I32, 1);\n    output.writeI32(this.type);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TArrayTypeEntry = module.exports.TArrayTypeEntry = function(args) {\n  this.objectTypePtr = null;\n  if (args) {\n    if (args.objectTypePtr !== undefined) {\n      this.objectTypePtr = args.objectTypePtr;\n    }\n  }\n};\nTArrayTypeEntry.prototype = {};\nTArrayTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.objectTypePtr = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTArrayTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TArrayTypeEntry');\n  if (this.objectTypePtr !== null && this.objectTypePtr !== undefined) {\n    output.writeFieldBegin('objectTypePtr', Thrift.Type.I32, 1);\n    output.writeI32(this.objectTypePtr);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TMapTypeEntry = module.exports.TMapTypeEntry = function(args) {\n  this.keyTypePtr = null;\n  this.valueTypePtr = null;\n  if (args) {\n    if (args.keyTypePtr !== undefined) {\n      this.keyTypePtr = args.keyTypePtr;\n    }\n    if (args.valueTypePtr !== undefined) {\n      this.valueTypePtr = args.valueTypePtr;\n    }\n  }\n};\nTMapTypeEntry.prototype = {};\nTMapTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.keyTypePtr = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.valueTypePtr = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTMapTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TMapTypeEntry');\n  if (this.keyTypePtr !== null && this.keyTypePtr !== undefined) {\n    output.writeFieldBegin('keyTypePtr', Thrift.Type.I32, 1);\n    output.writeI32(this.keyTypePtr);\n    output.writeFieldEnd();\n  }\n  if (this.valueTypePtr !== null && this.valueTypePtr !== undefined) {\n    output.writeFieldBegin('valueTypePtr', Thrift.Type.I32, 2);\n    output.writeI32(this.valueTypePtr);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TStructTypeEntry = module.exports.TStructTypeEntry = function(args) {\n  this.nameToTypePtr = null;\n  if (args) {\n    if (args.nameToTypePtr !== undefined) {\n      this.nameToTypePtr = args.nameToTypePtr;\n    }\n  }\n};\nTStructTypeEntry.prototype = {};\nTStructTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.MAP) {\n        var _size0 = 0;\n        var _rtmp34;\n        this.nameToTypePtr = {};\n        var _ktype1 = 0;\n        var _vtype2 = 0;\n        _rtmp34 = input.readMapBegin();\n        _ktype1 = _rtmp34.ktype;\n        _vtype2 = _rtmp34.vtype;\n        _size0 = _rtmp34.size;\n        for (var _i5 = 0; _i5 < _size0; ++_i5)\n        {\n          var key6 = null;\n          var val7 = null;\n          key6 = input.readString();\n          val7 = input.readI32();\n          this.nameToTypePtr[key6] = val7;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTStructTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TStructTypeEntry');\n  if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {\n    output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));\n    for (var kiter8 in this.nameToTypePtr)\n    {\n      if (this.nameToTypePtr.hasOwnProperty(kiter8))\n      {\n        var viter9 = this.nameToTypePtr[kiter8];\n        output.writeString(kiter8);\n        output.writeI32(viter9);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TUnionTypeEntry = module.exports.TUnionTypeEntry = function(args) {\n  this.nameToTypePtr = null;\n  if (args) {\n    if (args.nameToTypePtr !== undefined) {\n      this.nameToTypePtr = args.nameToTypePtr;\n    }\n  }\n};\nTUnionTypeEntry.prototype = {};\nTUnionTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.MAP) {\n        var _size10 = 0;\n        var _rtmp314;\n        this.nameToTypePtr = {};\n        var _ktype11 = 0;\n        var _vtype12 = 0;\n        _rtmp314 = input.readMapBegin();\n        _ktype11 = _rtmp314.ktype;\n        _vtype12 = _rtmp314.vtype;\n        _size10 = _rtmp314.size;\n        for (var _i15 = 0; _i15 < _size10; ++_i15)\n        {\n          var key16 = null;\n          var val17 = null;\n          key16 = input.readString();\n          val17 = input.readI32();\n          this.nameToTypePtr[key16] = val17;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTUnionTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TUnionTypeEntry');\n  if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {\n    output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));\n    for (var kiter18 in this.nameToTypePtr)\n    {\n      if (this.nameToTypePtr.hasOwnProperty(kiter18))\n      {\n        var viter19 = this.nameToTypePtr[kiter18];\n        output.writeString(kiter18);\n        output.writeI32(viter19);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TUserDefinedTypeEntry = module.exports.TUserDefinedTypeEntry = function(args) {\n  this.typeClassName = null;\n  if (args) {\n    if (args.typeClassName !== undefined) {\n      this.typeClassName = args.typeClassName;\n    }\n  }\n};\nTUserDefinedTypeEntry.prototype = {};\nTUserDefinedTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.typeClassName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTUserDefinedTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TUserDefinedTypeEntry');\n  if (this.typeClassName !== null && this.typeClassName !== undefined) {\n    output.writeFieldBegin('typeClassName', Thrift.Type.STRING, 1);\n    output.writeString(this.typeClassName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TTypeEntry = module.exports.TTypeEntry = function(args) {\n  this.primitiveEntry = null;\n  this.arrayEntry = null;\n  this.mapEntry = null;\n  this.structEntry = null;\n  this.unionEntry = null;\n  this.userDefinedTypeEntry = null;\n  if (args) {\n    if (args.primitiveEntry !== undefined) {\n      this.primitiveEntry = args.primitiveEntry;\n    }\n    if (args.arrayEntry !== undefined) {\n      this.arrayEntry = args.arrayEntry;\n    }\n    if (args.mapEntry !== undefined) {\n      this.mapEntry = args.mapEntry;\n    }\n    if (args.structEntry !== undefined) {\n      this.structEntry = args.structEntry;\n    }\n    if (args.unionEntry !== undefined) {\n      this.unionEntry = args.unionEntry;\n    }\n    if (args.userDefinedTypeEntry !== undefined) {\n      this.userDefinedTypeEntry = args.userDefinedTypeEntry;\n    }\n  }\n};\nTTypeEntry.prototype = {};\nTTypeEntry.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.primitiveEntry = new ttypes.TPrimitiveTypeEntry();\n        this.primitiveEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.arrayEntry = new ttypes.TArrayTypeEntry();\n        this.arrayEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.mapEntry = new ttypes.TMapTypeEntry();\n        this.mapEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.structEntry = new ttypes.TStructTypeEntry();\n        this.structEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.unionEntry = new ttypes.TUnionTypeEntry();\n        this.unionEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.userDefinedTypeEntry = new ttypes.TUserDefinedTypeEntry();\n        this.userDefinedTypeEntry.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTTypeEntry.prototype.write = function(output) {\n  output.writeStructBegin('TTypeEntry');\n  if (this.primitiveEntry !== null && this.primitiveEntry !== undefined) {\n    output.writeFieldBegin('primitiveEntry', Thrift.Type.STRUCT, 1);\n    this.primitiveEntry.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.arrayEntry !== null && this.arrayEntry !== undefined) {\n    output.writeFieldBegin('arrayEntry', Thrift.Type.STRUCT, 2);\n    this.arrayEntry.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.mapEntry !== null && this.mapEntry !== undefined) {\n    output.writeFieldBegin('mapEntry', Thrift.Type.STRUCT, 3);\n    this.mapEntry.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.structEntry !== null && this.structEntry !== undefined) {\n    output.writeFieldBegin('structEntry', Thrift.Type.STRUCT, 4);\n    this.structEntry.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.unionEntry !== null && this.unionEntry !== undefined) {\n    output.writeFieldBegin('unionEntry', Thrift.Type.STRUCT, 5);\n    this.unionEntry.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.userDefinedTypeEntry !== null && this.userDefinedTypeEntry !== undefined) {\n    output.writeFieldBegin('userDefinedTypeEntry', Thrift.Type.STRUCT, 6);\n    this.userDefinedTypeEntry.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TTypeDesc = module.exports.TTypeDesc = function(args) {\n  this.types = null;\n  if (args) {\n    if (args.types !== undefined) {\n      this.types = args.types;\n    }\n  }\n};\nTTypeDesc.prototype = {};\nTTypeDesc.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size20 = 0;\n        var _rtmp324;\n        this.types = [];\n        var _etype23 = 0;\n        _rtmp324 = input.readListBegin();\n        _etype23 = _rtmp324.etype;\n        _size20 = _rtmp324.size;\n        for (var _i25 = 0; _i25 < _size20; ++_i25)\n        {\n          var elem26 = null;\n          elem26 = new ttypes.TTypeEntry();\n          elem26.read(input);\n          this.types.push(elem26);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTTypeDesc.prototype.write = function(output) {\n  output.writeStructBegin('TTypeDesc');\n  if (this.types !== null && this.types !== undefined) {\n    output.writeFieldBegin('types', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.types.length);\n    for (var iter27 in this.types)\n    {\n      if (this.types.hasOwnProperty(iter27))\n      {\n        iter27 = this.types[iter27];\n        iter27.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TColumnDesc = module.exports.TColumnDesc = function(args) {\n  this.columnName = null;\n  this.typeDesc = null;\n  this.position = null;\n  this.comment = null;\n  if (args) {\n    if (args.columnName !== undefined) {\n      this.columnName = args.columnName;\n    }\n    if (args.typeDesc !== undefined) {\n      this.typeDesc = args.typeDesc;\n    }\n    if (args.position !== undefined) {\n      this.position = args.position;\n    }\n    if (args.comment !== undefined) {\n      this.comment = args.comment;\n    }\n  }\n};\nTColumnDesc.prototype = {};\nTColumnDesc.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.columnName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.typeDesc = new ttypes.TTypeDesc();\n        this.typeDesc.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.position = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.comment = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTColumnDesc.prototype.write = function(output) {\n  output.writeStructBegin('TColumnDesc');\n  if (this.columnName !== null && this.columnName !== undefined) {\n    output.writeFieldBegin('columnName', Thrift.Type.STRING, 1);\n    output.writeString(this.columnName);\n    output.writeFieldEnd();\n  }\n  if (this.typeDesc !== null && this.typeDesc !== undefined) {\n    output.writeFieldBegin('typeDesc', Thrift.Type.STRUCT, 2);\n    this.typeDesc.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.position !== null && this.position !== undefined) {\n    output.writeFieldBegin('position', Thrift.Type.I32, 3);\n    output.writeI32(this.position);\n    output.writeFieldEnd();\n  }\n  if (this.comment !== null && this.comment !== undefined) {\n    output.writeFieldBegin('comment', Thrift.Type.STRING, 4);\n    output.writeString(this.comment);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TTableSchema = module.exports.TTableSchema = function(args) {\n  this.columns = null;\n  if (args) {\n    if (args.columns !== undefined) {\n      this.columns = args.columns;\n    }\n  }\n};\nTTableSchema.prototype = {};\nTTableSchema.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size28 = 0;\n        var _rtmp332;\n        this.columns = [];\n        var _etype31 = 0;\n        _rtmp332 = input.readListBegin();\n        _etype31 = _rtmp332.etype;\n        _size28 = _rtmp332.size;\n        for (var _i33 = 0; _i33 < _size28; ++_i33)\n        {\n          var elem34 = null;\n          elem34 = new ttypes.TColumnDesc();\n          elem34.read(input);\n          this.columns.push(elem34);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTTableSchema.prototype.write = function(output) {\n  output.writeStructBegin('TTableSchema');\n  if (this.columns !== null && this.columns !== undefined) {\n    output.writeFieldBegin('columns', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);\n    for (var iter35 in this.columns)\n    {\n      if (this.columns.hasOwnProperty(iter35))\n      {\n        iter35 = this.columns[iter35];\n        iter35.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TBoolValue = module.exports.TBoolValue = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTBoolValue.prototype = {};\nTBoolValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.BOOL) {\n        this.value = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTBoolValue.prototype.write = function(output) {\n  output.writeStructBegin('TBoolValue');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.BOOL, 1);\n    output.writeBool(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TByteValue = module.exports.TByteValue = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTByteValue.prototype = {};\nTByteValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.BYTE) {\n        this.value = input.readByte();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTByteValue.prototype.write = function(output) {\n  output.writeStructBegin('TByteValue');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.BYTE, 1);\n    output.writeByte(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TI16Value = module.exports.TI16Value = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTI16Value.prototype = {};\nTI16Value.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I16) {\n        this.value = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTI16Value.prototype.write = function(output) {\n  output.writeStructBegin('TI16Value');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.I16, 1);\n    output.writeI16(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TI32Value = module.exports.TI32Value = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTI32Value.prototype = {};\nTI32Value.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.value = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTI32Value.prototype.write = function(output) {\n  output.writeStructBegin('TI32Value');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.I32, 1);\n    output.writeI32(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TI64Value = module.exports.TI64Value = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTI64Value.prototype = {};\nTI64Value.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I64) {\n        this.value = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTI64Value.prototype.write = function(output) {\n  output.writeStructBegin('TI64Value');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.I64, 1);\n    output.writeI64(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TDoubleValue = module.exports.TDoubleValue = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTDoubleValue.prototype = {};\nTDoubleValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.DOUBLE) {\n        this.value = input.readDouble();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTDoubleValue.prototype.write = function(output) {\n  output.writeStructBegin('TDoubleValue');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.DOUBLE, 1);\n    output.writeDouble(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TStringValue = module.exports.TStringValue = function(args) {\n  this.value = null;\n  if (args) {\n    if (args.value !== undefined) {\n      this.value = args.value;\n    }\n  }\n};\nTStringValue.prototype = {};\nTStringValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.value = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTStringValue.prototype.write = function(output) {\n  output.writeStructBegin('TStringValue');\n  if (this.value !== null && this.value !== undefined) {\n    output.writeFieldBegin('value', Thrift.Type.STRING, 1);\n    output.writeString(this.value);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TColumn = module.exports.TColumn = function(args) {\n  this.boolColumn = null;\n  this.byteColumn = null;\n  this.i16Column = null;\n  this.i32Column = null;\n  this.i64Column = null;\n  this.doubleColumn = null;\n  this.stringColumn = null;\n  if (args) {\n    if (args.boolColumn !== undefined) {\n      this.boolColumn = args.boolColumn;\n    }\n    if (args.byteColumn !== undefined) {\n      this.byteColumn = args.byteColumn;\n    }\n    if (args.i16Column !== undefined) {\n      this.i16Column = args.i16Column;\n    }\n    if (args.i32Column !== undefined) {\n      this.i32Column = args.i32Column;\n    }\n    if (args.i64Column !== undefined) {\n      this.i64Column = args.i64Column;\n    }\n    if (args.doubleColumn !== undefined) {\n      this.doubleColumn = args.doubleColumn;\n    }\n    if (args.stringColumn !== undefined) {\n      this.stringColumn = args.stringColumn;\n    }\n  }\n};\nTColumn.prototype = {};\nTColumn.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size36 = 0;\n        var _rtmp340;\n        this.boolColumn = [];\n        var _etype39 = 0;\n        _rtmp340 = input.readListBegin();\n        _etype39 = _rtmp340.etype;\n        _size36 = _rtmp340.size;\n        for (var _i41 = 0; _i41 < _size36; ++_i41)\n        {\n          var elem42 = null;\n          elem42 = new ttypes.TBoolValue();\n          elem42.read(input);\n          this.boolColumn.push(elem42);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.LIST) {\n        var _size43 = 0;\n        var _rtmp347;\n        this.byteColumn = [];\n        var _etype46 = 0;\n        _rtmp347 = input.readListBegin();\n        _etype46 = _rtmp347.etype;\n        _size43 = _rtmp347.size;\n        for (var _i48 = 0; _i48 < _size43; ++_i48)\n        {\n          var elem49 = null;\n          elem49 = new ttypes.TByteValue();\n          elem49.read(input);\n          this.byteColumn.push(elem49);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size50 = 0;\n        var _rtmp354;\n        this.i16Column = [];\n        var _etype53 = 0;\n        _rtmp354 = input.readListBegin();\n        _etype53 = _rtmp354.etype;\n        _size50 = _rtmp354.size;\n        for (var _i55 = 0; _i55 < _size50; ++_i55)\n        {\n          var elem56 = null;\n          elem56 = new ttypes.TI16Value();\n          elem56.read(input);\n          this.i16Column.push(elem56);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.LIST) {\n        var _size57 = 0;\n        var _rtmp361;\n        this.i32Column = [];\n        var _etype60 = 0;\n        _rtmp361 = input.readListBegin();\n        _etype60 = _rtmp361.etype;\n        _size57 = _rtmp361.size;\n        for (var _i62 = 0; _i62 < _size57; ++_i62)\n        {\n          var elem63 = null;\n          elem63 = new ttypes.TI32Value();\n          elem63.read(input);\n          this.i32Column.push(elem63);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.LIST) {\n        var _size64 = 0;\n        var _rtmp368;\n        this.i64Column = [];\n        var _etype67 = 0;\n        _rtmp368 = input.readListBegin();\n        _etype67 = _rtmp368.etype;\n        _size64 = _rtmp368.size;\n        for (var _i69 = 0; _i69 < _size64; ++_i69)\n        {\n          var elem70 = null;\n          elem70 = new ttypes.TI64Value();\n          elem70.read(input);\n          this.i64Column.push(elem70);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.LIST) {\n        var _size71 = 0;\n        var _rtmp375;\n        this.doubleColumn = [];\n        var _etype74 = 0;\n        _rtmp375 = input.readListBegin();\n        _etype74 = _rtmp375.etype;\n        _size71 = _rtmp375.size;\n        for (var _i76 = 0; _i76 < _size71; ++_i76)\n        {\n          var elem77 = null;\n          elem77 = new ttypes.TDoubleValue();\n          elem77.read(input);\n          this.doubleColumn.push(elem77);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.LIST) {\n        var _size78 = 0;\n        var _rtmp382;\n        this.stringColumn = [];\n        var _etype81 = 0;\n        _rtmp382 = input.readListBegin();\n        _etype81 = _rtmp382.etype;\n        _size78 = _rtmp382.size;\n        for (var _i83 = 0; _i83 < _size78; ++_i83)\n        {\n          var elem84 = null;\n          elem84 = new ttypes.TStringValue();\n          elem84.read(input);\n          this.stringColumn.push(elem84);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTColumn.prototype.write = function(output) {\n  output.writeStructBegin('TColumn');\n  if (this.boolColumn !== null && this.boolColumn !== undefined) {\n    output.writeFieldBegin('boolColumn', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.boolColumn.length);\n    for (var iter85 in this.boolColumn)\n    {\n      if (this.boolColumn.hasOwnProperty(iter85))\n      {\n        iter85 = this.boolColumn[iter85];\n        iter85.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.byteColumn !== null && this.byteColumn !== undefined) {\n    output.writeFieldBegin('byteColumn', Thrift.Type.LIST, 2);\n    output.writeListBegin(Thrift.Type.STRUCT, this.byteColumn.length);\n    for (var iter86 in this.byteColumn)\n    {\n      if (this.byteColumn.hasOwnProperty(iter86))\n      {\n        iter86 = this.byteColumn[iter86];\n        iter86.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.i16Column !== null && this.i16Column !== undefined) {\n    output.writeFieldBegin('i16Column', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRUCT, this.i16Column.length);\n    for (var iter87 in this.i16Column)\n    {\n      if (this.i16Column.hasOwnProperty(iter87))\n      {\n        iter87 = this.i16Column[iter87];\n        iter87.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.i32Column !== null && this.i32Column !== undefined) {\n    output.writeFieldBegin('i32Column', Thrift.Type.LIST, 4);\n    output.writeListBegin(Thrift.Type.STRUCT, this.i32Column.length);\n    for (var iter88 in this.i32Column)\n    {\n      if (this.i32Column.hasOwnProperty(iter88))\n      {\n        iter88 = this.i32Column[iter88];\n        iter88.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.i64Column !== null && this.i64Column !== undefined) {\n    output.writeFieldBegin('i64Column', Thrift.Type.LIST, 5);\n    output.writeListBegin(Thrift.Type.STRUCT, this.i64Column.length);\n    for (var iter89 in this.i64Column)\n    {\n      if (this.i64Column.hasOwnProperty(iter89))\n      {\n        iter89 = this.i64Column[iter89];\n        iter89.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.doubleColumn !== null && this.doubleColumn !== undefined) {\n    output.writeFieldBegin('doubleColumn', Thrift.Type.LIST, 6);\n    output.writeListBegin(Thrift.Type.STRUCT, this.doubleColumn.length);\n    for (var iter90 in this.doubleColumn)\n    {\n      if (this.doubleColumn.hasOwnProperty(iter90))\n      {\n        iter90 = this.doubleColumn[iter90];\n        iter90.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.stringColumn !== null && this.stringColumn !== undefined) {\n    output.writeFieldBegin('stringColumn', Thrift.Type.LIST, 7);\n    output.writeListBegin(Thrift.Type.STRUCT, this.stringColumn.length);\n    for (var iter91 in this.stringColumn)\n    {\n      if (this.stringColumn.hasOwnProperty(iter91))\n      {\n        iter91 = this.stringColumn[iter91];\n        iter91.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TColumnValue = module.exports.TColumnValue = function(args) {\n  this.boolVal = null;\n  this.byteVal = null;\n  this.i16Val = null;\n  this.i32Val = null;\n  this.i64Val = null;\n  this.doubleVal = null;\n  this.stringVal = null;\n  if (args) {\n    if (args.boolVal !== undefined) {\n      this.boolVal = args.boolVal;\n    }\n    if (args.byteVal !== undefined) {\n      this.byteVal = args.byteVal;\n    }\n    if (args.i16Val !== undefined) {\n      this.i16Val = args.i16Val;\n    }\n    if (args.i32Val !== undefined) {\n      this.i32Val = args.i32Val;\n    }\n    if (args.i64Val !== undefined) {\n      this.i64Val = args.i64Val;\n    }\n    if (args.doubleVal !== undefined) {\n      this.doubleVal = args.doubleVal;\n    }\n    if (args.stringVal !== undefined) {\n      this.stringVal = args.stringVal;\n    }\n  }\n};\nTColumnValue.prototype = {};\nTColumnValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.boolVal = new ttypes.TBoolValue();\n        this.boolVal.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.byteVal = new ttypes.TByteValue();\n        this.byteVal.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.i16Val = new ttypes.TI16Value();\n        this.i16Val.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.i32Val = new ttypes.TI32Value();\n        this.i32Val.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.i64Val = new ttypes.TI64Value();\n        this.i64Val.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.doubleVal = new ttypes.TDoubleValue();\n        this.doubleVal.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 7:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.stringVal = new ttypes.TStringValue();\n        this.stringVal.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTColumnValue.prototype.write = function(output) {\n  output.writeStructBegin('TColumnValue');\n  if (this.boolVal !== null && this.boolVal !== undefined) {\n    output.writeFieldBegin('boolVal', Thrift.Type.STRUCT, 1);\n    this.boolVal.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.byteVal !== null && this.byteVal !== undefined) {\n    output.writeFieldBegin('byteVal', Thrift.Type.STRUCT, 2);\n    this.byteVal.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.i16Val !== null && this.i16Val !== undefined) {\n    output.writeFieldBegin('i16Val', Thrift.Type.STRUCT, 3);\n    this.i16Val.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.i32Val !== null && this.i32Val !== undefined) {\n    output.writeFieldBegin('i32Val', Thrift.Type.STRUCT, 4);\n    this.i32Val.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.i64Val !== null && this.i64Val !== undefined) {\n    output.writeFieldBegin('i64Val', Thrift.Type.STRUCT, 5);\n    this.i64Val.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.doubleVal !== null && this.doubleVal !== undefined) {\n    output.writeFieldBegin('doubleVal', Thrift.Type.STRUCT, 6);\n    this.doubleVal.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.stringVal !== null && this.stringVal !== undefined) {\n    output.writeFieldBegin('stringVal', Thrift.Type.STRUCT, 7);\n    this.stringVal.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TRow = module.exports.TRow = function(args) {\n  this.colVals = null;\n  if (args) {\n    if (args.colVals !== undefined) {\n      this.colVals = args.colVals;\n    }\n  }\n};\nTRow.prototype = {};\nTRow.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.LIST) {\n        var _size92 = 0;\n        var _rtmp396;\n        this.colVals = [];\n        var _etype95 = 0;\n        _rtmp396 = input.readListBegin();\n        _etype95 = _rtmp396.etype;\n        _size92 = _rtmp396.size;\n        for (var _i97 = 0; _i97 < _size92; ++_i97)\n        {\n          var elem98 = null;\n          elem98 = new ttypes.TColumnValue();\n          elem98.read(input);\n          this.colVals.push(elem98);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTRow.prototype.write = function(output) {\n  output.writeStructBegin('TRow');\n  if (this.colVals !== null && this.colVals !== undefined) {\n    output.writeFieldBegin('colVals', Thrift.Type.LIST, 1);\n    output.writeListBegin(Thrift.Type.STRUCT, this.colVals.length);\n    for (var iter99 in this.colVals)\n    {\n      if (this.colVals.hasOwnProperty(iter99))\n      {\n        iter99 = this.colVals[iter99];\n        iter99.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TRowSet = module.exports.TRowSet = function(args) {\n  this.startRowOffset = null;\n  this.rows = null;\n  this.columns = null;\n  if (args) {\n    if (args.startRowOffset !== undefined) {\n      this.startRowOffset = args.startRowOffset;\n    }\n    if (args.rows !== undefined) {\n      this.rows = args.rows;\n    }\n    if (args.columns !== undefined) {\n      this.columns = args.columns;\n    }\n  }\n};\nTRowSet.prototype = {};\nTRowSet.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I64) {\n        this.startRowOffset = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.LIST) {\n        var _size100 = 0;\n        var _rtmp3104;\n        this.rows = [];\n        var _etype103 = 0;\n        _rtmp3104 = input.readListBegin();\n        _etype103 = _rtmp3104.etype;\n        _size100 = _rtmp3104.size;\n        for (var _i105 = 0; _i105 < _size100; ++_i105)\n        {\n          var elem106 = null;\n          elem106 = new ttypes.TRow();\n          elem106.read(input);\n          this.rows.push(elem106);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.LIST) {\n        var _size107 = 0;\n        var _rtmp3111;\n        this.columns = [];\n        var _etype110 = 0;\n        _rtmp3111 = input.readListBegin();\n        _etype110 = _rtmp3111.etype;\n        _size107 = _rtmp3111.size;\n        for (var _i112 = 0; _i112 < _size107; ++_i112)\n        {\n          var elem113 = null;\n          elem113 = new ttypes.TColumn();\n          elem113.read(input);\n          this.columns.push(elem113);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTRowSet.prototype.write = function(output) {\n  output.writeStructBegin('TRowSet');\n  if (this.startRowOffset !== null && this.startRowOffset !== undefined) {\n    output.writeFieldBegin('startRowOffset', Thrift.Type.I64, 1);\n    output.writeI64(this.startRowOffset);\n    output.writeFieldEnd();\n  }\n  if (this.rows !== null && this.rows !== undefined) {\n    output.writeFieldBegin('rows', Thrift.Type.LIST, 2);\n    output.writeListBegin(Thrift.Type.STRUCT, this.rows.length);\n    for (var iter114 in this.rows)\n    {\n      if (this.rows.hasOwnProperty(iter114))\n      {\n        iter114 = this.rows[iter114];\n        iter114.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.columns !== null && this.columns !== undefined) {\n    output.writeFieldBegin('columns', Thrift.Type.LIST, 3);\n    output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);\n    for (var iter115 in this.columns)\n    {\n      if (this.columns.hasOwnProperty(iter115))\n      {\n        iter115 = this.columns[iter115];\n        iter115.write(output);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TStatus = module.exports.TStatus = function(args) {\n  this.statusCode = null;\n  this.infoMessages = null;\n  this.sqlState = null;\n  this.errorCode = null;\n  this.errorMessage = null;\n  if (args) {\n    if (args.statusCode !== undefined) {\n      this.statusCode = args.statusCode;\n    }\n    if (args.infoMessages !== undefined) {\n      this.infoMessages = args.infoMessages;\n    }\n    if (args.sqlState !== undefined) {\n      this.sqlState = args.sqlState;\n    }\n    if (args.errorCode !== undefined) {\n      this.errorCode = args.errorCode;\n    }\n    if (args.errorMessage !== undefined) {\n      this.errorMessage = args.errorMessage;\n    }\n  }\n};\nTStatus.prototype = {};\nTStatus.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.statusCode = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.LIST) {\n        var _size116 = 0;\n        var _rtmp3120;\n        this.infoMessages = [];\n        var _etype119 = 0;\n        _rtmp3120 = input.readListBegin();\n        _etype119 = _rtmp3120.etype;\n        _size116 = _rtmp3120.size;\n        for (var _i121 = 0; _i121 < _size116; ++_i121)\n        {\n          var elem122 = null;\n          elem122 = input.readString();\n          this.infoMessages.push(elem122);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.sqlState = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.errorCode = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRING) {\n        this.errorMessage = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTStatus.prototype.write = function(output) {\n  output.writeStructBegin('TStatus');\n  if (this.statusCode !== null && this.statusCode !== undefined) {\n    output.writeFieldBegin('statusCode', Thrift.Type.I32, 1);\n    output.writeI32(this.statusCode);\n    output.writeFieldEnd();\n  }\n  if (this.infoMessages !== null && this.infoMessages !== undefined) {\n    output.writeFieldBegin('infoMessages', Thrift.Type.LIST, 2);\n    output.writeListBegin(Thrift.Type.STRING, this.infoMessages.length);\n    for (var iter123 in this.infoMessages)\n    {\n      if (this.infoMessages.hasOwnProperty(iter123))\n      {\n        iter123 = this.infoMessages[iter123];\n        output.writeString(iter123);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  if (this.sqlState !== null && this.sqlState !== undefined) {\n    output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3);\n    output.writeString(this.sqlState);\n    output.writeFieldEnd();\n  }\n  if (this.errorCode !== null && this.errorCode !== undefined) {\n    output.writeFieldBegin('errorCode', Thrift.Type.I32, 4);\n    output.writeI32(this.errorCode);\n    output.writeFieldEnd();\n  }\n  if (this.errorMessage !== null && this.errorMessage !== undefined) {\n    output.writeFieldBegin('errorMessage', Thrift.Type.STRING, 5);\n    output.writeString(this.errorMessage);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar THandleIdentifier = module.exports.THandleIdentifier = function(args) {\n  this.guid = null;\n  this.secret = null;\n  if (args) {\n    if (args.guid !== undefined) {\n      this.guid = args.guid;\n    }\n    if (args.secret !== undefined) {\n      this.secret = args.secret;\n    }\n  }\n};\nTHandleIdentifier.prototype = {};\nTHandleIdentifier.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.guid = input.readBinary();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.secret = input.readBinary();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTHandleIdentifier.prototype.write = function(output) {\n  output.writeStructBegin('THandleIdentifier');\n  if (this.guid !== null && this.guid !== undefined) {\n    output.writeFieldBegin('guid', Thrift.Type.STRING, 1);\n    output.writeBinary(this.guid);\n    output.writeFieldEnd();\n  }\n  if (this.secret !== null && this.secret !== undefined) {\n    output.writeFieldBegin('secret', Thrift.Type.STRING, 2);\n    output.writeBinary(this.secret);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TSessionHandle = module.exports.TSessionHandle = function(args) {\n  this.sessionId = null;\n  if (args) {\n    if (args.sessionId !== undefined) {\n      this.sessionId = args.sessionId;\n    }\n  }\n};\nTSessionHandle.prototype = {};\nTSessionHandle.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionId = new ttypes.THandleIdentifier();\n        this.sessionId.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTSessionHandle.prototype.write = function(output) {\n  output.writeStructBegin('TSessionHandle');\n  if (this.sessionId !== null && this.sessionId !== undefined) {\n    output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 1);\n    this.sessionId.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TOperationHandle = module.exports.TOperationHandle = function(args) {\n  this.operationId = null;\n  this.operationType = null;\n  this.hasResultSet = null;\n  this.modifiedRowCount = null;\n  if (args) {\n    if (args.operationId !== undefined) {\n      this.operationId = args.operationId;\n    }\n    if (args.operationType !== undefined) {\n      this.operationType = args.operationType;\n    }\n    if (args.hasResultSet !== undefined) {\n      this.hasResultSet = args.hasResultSet;\n    }\n    if (args.modifiedRowCount !== undefined) {\n      this.modifiedRowCount = args.modifiedRowCount;\n    }\n  }\n};\nTOperationHandle.prototype = {};\nTOperationHandle.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationId = new ttypes.THandleIdentifier();\n        this.operationId.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.operationType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.BOOL) {\n        this.hasResultSet = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.DOUBLE) {\n        this.modifiedRowCount = input.readDouble();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTOperationHandle.prototype.write = function(output) {\n  output.writeStructBegin('TOperationHandle');\n  if (this.operationId !== null && this.operationId !== undefined) {\n    output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 1);\n    this.operationId.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationType !== null && this.operationType !== undefined) {\n    output.writeFieldBegin('operationType', Thrift.Type.I32, 2);\n    output.writeI32(this.operationType);\n    output.writeFieldEnd();\n  }\n  if (this.hasResultSet !== null && this.hasResultSet !== undefined) {\n    output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 3);\n    output.writeBool(this.hasResultSet);\n    output.writeFieldEnd();\n  }\n  if (this.modifiedRowCount !== null && this.modifiedRowCount !== undefined) {\n    output.writeFieldBegin('modifiedRowCount', Thrift.Type.DOUBLE, 4);\n    output.writeDouble(this.modifiedRowCount);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TOpenSessionReq = module.exports.TOpenSessionReq = function(args) {\n  this.client_protocol = 0;\n  this.username = null;\n  this.password = null;\n  this.configuration = null;\n  if (args) {\n    if (args.client_protocol !== undefined) {\n      this.client_protocol = args.client_protocol;\n    }\n    if (args.username !== undefined) {\n      this.username = args.username;\n    }\n    if (args.password !== undefined) {\n      this.password = args.password;\n    }\n    if (args.configuration !== undefined) {\n      this.configuration = args.configuration;\n    }\n  }\n};\nTOpenSessionReq.prototype = {};\nTOpenSessionReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.I32) {\n        this.client_protocol = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.username = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.password = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size124 = 0;\n        var _rtmp3128;\n        this.configuration = {};\n        var _ktype125 = 0;\n        var _vtype126 = 0;\n        _rtmp3128 = input.readMapBegin();\n        _ktype125 = _rtmp3128.ktype;\n        _vtype126 = _rtmp3128.vtype;\n        _size124 = _rtmp3128.size;\n        for (var _i129 = 0; _i129 < _size124; ++_i129)\n        {\n          var key130 = null;\n          var val131 = null;\n          key130 = input.readString();\n          val131 = input.readString();\n          this.configuration[key130] = val131;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTOpenSessionReq.prototype.write = function(output) {\n  output.writeStructBegin('TOpenSessionReq');\n  if (this.client_protocol !== null && this.client_protocol !== undefined) {\n    output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1);\n    output.writeI32(this.client_protocol);\n    output.writeFieldEnd();\n  }\n  if (this.username !== null && this.username !== undefined) {\n    output.writeFieldBegin('username', Thrift.Type.STRING, 2);\n    output.writeString(this.username);\n    output.writeFieldEnd();\n  }\n  if (this.password !== null && this.password !== undefined) {\n    output.writeFieldBegin('password', Thrift.Type.STRING, 3);\n    output.writeString(this.password);\n    output.writeFieldEnd();\n  }\n  if (this.configuration !== null && this.configuration !== undefined) {\n    output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));\n    for (var kiter132 in this.configuration)\n    {\n      if (this.configuration.hasOwnProperty(kiter132))\n      {\n        var viter133 = this.configuration[kiter132];\n        output.writeString(kiter132);\n        output.writeString(viter133);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TOpenSessionResp = module.exports.TOpenSessionResp = function(args) {\n  this.status = null;\n  this.serverProtocolVersion = 0;\n  this.sessionHandle = null;\n  this.configuration = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.serverProtocolVersion !== undefined) {\n      this.serverProtocolVersion = args.serverProtocolVersion;\n    }\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.configuration !== undefined) {\n      this.configuration = args.configuration;\n    }\n  }\n};\nTOpenSessionResp.prototype = {};\nTOpenSessionResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.serverProtocolVersion = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.MAP) {\n        var _size134 = 0;\n        var _rtmp3138;\n        this.configuration = {};\n        var _ktype135 = 0;\n        var _vtype136 = 0;\n        _rtmp3138 = input.readMapBegin();\n        _ktype135 = _rtmp3138.ktype;\n        _vtype136 = _rtmp3138.vtype;\n        _size134 = _rtmp3138.size;\n        for (var _i139 = 0; _i139 < _size134; ++_i139)\n        {\n          var key140 = null;\n          var val141 = null;\n          key140 = input.readString();\n          val141 = input.readString();\n          this.configuration[key140] = val141;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTOpenSessionResp.prototype.write = function(output) {\n  output.writeStructBegin('TOpenSessionResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) {\n    output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2);\n    output.writeI32(this.serverProtocolVersion);\n    output.writeFieldEnd();\n  }\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 3);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.configuration !== null && this.configuration !== undefined) {\n    output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));\n    for (var kiter142 in this.configuration)\n    {\n      if (this.configuration.hasOwnProperty(kiter142))\n      {\n        var viter143 = this.configuration[kiter142];\n        output.writeString(kiter142);\n        output.writeString(viter143);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCloseSessionReq = module.exports.TCloseSessionReq = function(args) {\n  this.sessionHandle = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n  }\n};\nTCloseSessionReq.prototype = {};\nTCloseSessionReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCloseSessionReq.prototype.write = function(output) {\n  output.writeStructBegin('TCloseSessionReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCloseSessionResp = module.exports.TCloseSessionResp = function(args) {\n  this.status = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n  }\n};\nTCloseSessionResp.prototype = {};\nTCloseSessionResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCloseSessionResp.prototype.write = function(output) {\n  output.writeStructBegin('TCloseSessionResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetInfoValue = module.exports.TGetInfoValue = function(args) {\n  this.stringValue = null;\n  this.smallIntValue = null;\n  this.integerBitmask = null;\n  this.integerFlag = null;\n  this.binaryValue = null;\n  this.lenValue = null;\n  if (args) {\n    if (args.stringValue !== undefined) {\n      this.stringValue = args.stringValue;\n    }\n    if (args.smallIntValue !== undefined) {\n      this.smallIntValue = args.smallIntValue;\n    }\n    if (args.integerBitmask !== undefined) {\n      this.integerBitmask = args.integerBitmask;\n    }\n    if (args.integerFlag !== undefined) {\n      this.integerFlag = args.integerFlag;\n    }\n    if (args.binaryValue !== undefined) {\n      this.binaryValue = args.binaryValue;\n    }\n    if (args.lenValue !== undefined) {\n      this.lenValue = args.lenValue;\n    }\n  }\n};\nTGetInfoValue.prototype = {};\nTGetInfoValue.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRING) {\n        this.stringValue = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I16) {\n        this.smallIntValue = input.readI16();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I32) {\n        this.integerBitmask = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.I32) {\n        this.integerFlag = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.I32) {\n        this.binaryValue = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 6:\n      if (ftype == Thrift.Type.I64) {\n        this.lenValue = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetInfoValue.prototype.write = function(output) {\n  output.writeStructBegin('TGetInfoValue');\n  if (this.stringValue !== null && this.stringValue !== undefined) {\n    output.writeFieldBegin('stringValue', Thrift.Type.STRING, 1);\n    output.writeString(this.stringValue);\n    output.writeFieldEnd();\n  }\n  if (this.smallIntValue !== null && this.smallIntValue !== undefined) {\n    output.writeFieldBegin('smallIntValue', Thrift.Type.I16, 2);\n    output.writeI16(this.smallIntValue);\n    output.writeFieldEnd();\n  }\n  if (this.integerBitmask !== null && this.integerBitmask !== undefined) {\n    output.writeFieldBegin('integerBitmask', Thrift.Type.I32, 3);\n    output.writeI32(this.integerBitmask);\n    output.writeFieldEnd();\n  }\n  if (this.integerFlag !== null && this.integerFlag !== undefined) {\n    output.writeFieldBegin('integerFlag', Thrift.Type.I32, 4);\n    output.writeI32(this.integerFlag);\n    output.writeFieldEnd();\n  }\n  if (this.binaryValue !== null && this.binaryValue !== undefined) {\n    output.writeFieldBegin('binaryValue', Thrift.Type.I32, 5);\n    output.writeI32(this.binaryValue);\n    output.writeFieldEnd();\n  }\n  if (this.lenValue !== null && this.lenValue !== undefined) {\n    output.writeFieldBegin('lenValue', Thrift.Type.I64, 6);\n    output.writeI64(this.lenValue);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetInfoReq = module.exports.TGetInfoReq = function(args) {\n  this.sessionHandle = null;\n  this.infoType = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.infoType !== undefined) {\n      this.infoType = args.infoType;\n    }\n  }\n};\nTGetInfoReq.prototype = {};\nTGetInfoReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.infoType = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetInfoReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetInfoReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.infoType !== null && this.infoType !== undefined) {\n    output.writeFieldBegin('infoType', Thrift.Type.I32, 2);\n    output.writeI32(this.infoType);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetInfoResp = module.exports.TGetInfoResp = function(args) {\n  this.status = null;\n  this.infoValue = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.infoValue !== undefined) {\n      this.infoValue = args.infoValue;\n    }\n  }\n};\nTGetInfoResp.prototype = {};\nTGetInfoResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.infoValue = new ttypes.TGetInfoValue();\n        this.infoValue.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetInfoResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetInfoResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.infoValue !== null && this.infoValue !== undefined) {\n    output.writeFieldBegin('infoValue', Thrift.Type.STRUCT, 2);\n    this.infoValue.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TExecuteStatementReq = module.exports.TExecuteStatementReq = function(args) {\n  this.sessionHandle = null;\n  this.statement = null;\n  this.confOverlay = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.statement !== undefined) {\n      this.statement = args.statement;\n    }\n    if (args.confOverlay !== undefined) {\n      this.confOverlay = args.confOverlay;\n    }\n  }\n};\nTExecuteStatementReq.prototype = {};\nTExecuteStatementReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.statement = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.MAP) {\n        var _size144 = 0;\n        var _rtmp3148;\n        this.confOverlay = {};\n        var _ktype145 = 0;\n        var _vtype146 = 0;\n        _rtmp3148 = input.readMapBegin();\n        _ktype145 = _rtmp3148.ktype;\n        _vtype146 = _rtmp3148.vtype;\n        _size144 = _rtmp3148.size;\n        for (var _i149 = 0; _i149 < _size144; ++_i149)\n        {\n          var key150 = null;\n          var val151 = null;\n          key150 = input.readString();\n          val151 = input.readString();\n          this.confOverlay[key150] = val151;\n        }\n        input.readMapEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTExecuteStatementReq.prototype.write = function(output) {\n  output.writeStructBegin('TExecuteStatementReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.statement !== null && this.statement !== undefined) {\n    output.writeFieldBegin('statement', Thrift.Type.STRING, 2);\n    output.writeString(this.statement);\n    output.writeFieldEnd();\n  }\n  if (this.confOverlay !== null && this.confOverlay !== undefined) {\n    output.writeFieldBegin('confOverlay', Thrift.Type.MAP, 3);\n    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.confOverlay));\n    for (var kiter152 in this.confOverlay)\n    {\n      if (this.confOverlay.hasOwnProperty(kiter152))\n      {\n        var viter153 = this.confOverlay[kiter152];\n        output.writeString(kiter152);\n        output.writeString(viter153);\n      }\n    }\n    output.writeMapEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TExecuteStatementResp = module.exports.TExecuteStatementResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTExecuteStatementResp.prototype = {};\nTExecuteStatementResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTExecuteStatementResp.prototype.write = function(output) {\n  output.writeStructBegin('TExecuteStatementResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTypeInfoReq = module.exports.TGetTypeInfoReq = function(args) {\n  this.sessionHandle = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n  }\n};\nTGetTypeInfoReq.prototype = {};\nTGetTypeInfoReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTypeInfoReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetTypeInfoReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTypeInfoResp = module.exports.TGetTypeInfoResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetTypeInfoResp.prototype = {};\nTGetTypeInfoResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTypeInfoResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetTypeInfoResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetCatalogsReq = module.exports.TGetCatalogsReq = function(args) {\n  this.sessionHandle = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n  }\n};\nTGetCatalogsReq.prototype = {};\nTGetCatalogsReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetCatalogsReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetCatalogsReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetCatalogsResp = module.exports.TGetCatalogsResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetCatalogsResp.prototype = {};\nTGetCatalogsResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetCatalogsResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetCatalogsResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetSchemasReq = module.exports.TGetSchemasReq = function(args) {\n  this.sessionHandle = null;\n  this.catalogName = null;\n  this.schemaName = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.catalogName !== undefined) {\n      this.catalogName = args.catalogName;\n    }\n    if (args.schemaName !== undefined) {\n      this.schemaName = args.schemaName;\n    }\n  }\n};\nTGetSchemasReq.prototype = {};\nTGetSchemasReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.catalogName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.schemaName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetSchemasReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetSchemasReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.catalogName !== null && this.catalogName !== undefined) {\n    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);\n    output.writeString(this.catalogName);\n    output.writeFieldEnd();\n  }\n  if (this.schemaName !== null && this.schemaName !== undefined) {\n    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);\n    output.writeString(this.schemaName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetSchemasResp = module.exports.TGetSchemasResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetSchemasResp.prototype = {};\nTGetSchemasResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetSchemasResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetSchemasResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTablesReq = module.exports.TGetTablesReq = function(args) {\n  this.sessionHandle = null;\n  this.catalogName = null;\n  this.schemaName = null;\n  this.tableName = null;\n  this.tableTypes = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.catalogName !== undefined) {\n      this.catalogName = args.catalogName;\n    }\n    if (args.schemaName !== undefined) {\n      this.schemaName = args.schemaName;\n    }\n    if (args.tableName !== undefined) {\n      this.tableName = args.tableName;\n    }\n    if (args.tableTypes !== undefined) {\n      this.tableTypes = args.tableTypes;\n    }\n  }\n};\nTGetTablesReq.prototype = {};\nTGetTablesReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.catalogName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.schemaName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.tableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.LIST) {\n        var _size154 = 0;\n        var _rtmp3158;\n        this.tableTypes = [];\n        var _etype157 = 0;\n        _rtmp3158 = input.readListBegin();\n        _etype157 = _rtmp3158.etype;\n        _size154 = _rtmp3158.size;\n        for (var _i159 = 0; _i159 < _size154; ++_i159)\n        {\n          var elem160 = null;\n          elem160 = input.readString();\n          this.tableTypes.push(elem160);\n        }\n        input.readListEnd();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTablesReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetTablesReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.catalogName !== null && this.catalogName !== undefined) {\n    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);\n    output.writeString(this.catalogName);\n    output.writeFieldEnd();\n  }\n  if (this.schemaName !== null && this.schemaName !== undefined) {\n    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);\n    output.writeString(this.schemaName);\n    output.writeFieldEnd();\n  }\n  if (this.tableName !== null && this.tableName !== undefined) {\n    output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);\n    output.writeString(this.tableName);\n    output.writeFieldEnd();\n  }\n  if (this.tableTypes !== null && this.tableTypes !== undefined) {\n    output.writeFieldBegin('tableTypes', Thrift.Type.LIST, 5);\n    output.writeListBegin(Thrift.Type.STRING, this.tableTypes.length);\n    for (var iter161 in this.tableTypes)\n    {\n      if (this.tableTypes.hasOwnProperty(iter161))\n      {\n        iter161 = this.tableTypes[iter161];\n        output.writeString(iter161);\n      }\n    }\n    output.writeListEnd();\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTablesResp = module.exports.TGetTablesResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetTablesResp.prototype = {};\nTGetTablesResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTablesResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetTablesResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTableTypesReq = module.exports.TGetTableTypesReq = function(args) {\n  this.sessionHandle = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n  }\n};\nTGetTableTypesReq.prototype = {};\nTGetTableTypesReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTableTypesReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetTableTypesReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetTableTypesResp = module.exports.TGetTableTypesResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetTableTypesResp.prototype = {};\nTGetTableTypesResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetTableTypesResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetTableTypesResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetColumnsReq = module.exports.TGetColumnsReq = function(args) {\n  this.sessionHandle = null;\n  this.catalogName = null;\n  this.schemaName = null;\n  this.tableName = null;\n  this.columnName = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.catalogName !== undefined) {\n      this.catalogName = args.catalogName;\n    }\n    if (args.schemaName !== undefined) {\n      this.schemaName = args.schemaName;\n    }\n    if (args.tableName !== undefined) {\n      this.tableName = args.tableName;\n    }\n    if (args.columnName !== undefined) {\n      this.columnName = args.columnName;\n    }\n  }\n};\nTGetColumnsReq.prototype = {};\nTGetColumnsReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.catalogName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.schemaName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.tableName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 5:\n      if (ftype == Thrift.Type.STRING) {\n        this.columnName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetColumnsReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetColumnsReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.catalogName !== null && this.catalogName !== undefined) {\n    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);\n    output.writeString(this.catalogName);\n    output.writeFieldEnd();\n  }\n  if (this.schemaName !== null && this.schemaName !== undefined) {\n    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);\n    output.writeString(this.schemaName);\n    output.writeFieldEnd();\n  }\n  if (this.tableName !== null && this.tableName !== undefined) {\n    output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);\n    output.writeString(this.tableName);\n    output.writeFieldEnd();\n  }\n  if (this.columnName !== null && this.columnName !== undefined) {\n    output.writeFieldBegin('columnName', Thrift.Type.STRING, 5);\n    output.writeString(this.columnName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetColumnsResp = module.exports.TGetColumnsResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetColumnsResp.prototype = {};\nTGetColumnsResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetColumnsResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetColumnsResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetFunctionsReq = module.exports.TGetFunctionsReq = function(args) {\n  this.sessionHandle = null;\n  this.catalogName = null;\n  this.schemaName = null;\n  this.functionName = null;\n  if (args) {\n    if (args.sessionHandle !== undefined) {\n      this.sessionHandle = args.sessionHandle;\n    }\n    if (args.catalogName !== undefined) {\n      this.catalogName = args.catalogName;\n    }\n    if (args.schemaName !== undefined) {\n      this.schemaName = args.schemaName;\n    }\n    if (args.functionName !== undefined) {\n      this.functionName = args.functionName;\n    }\n  }\n};\nTGetFunctionsReq.prototype = {};\nTGetFunctionsReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.sessionHandle = new ttypes.TSessionHandle();\n        this.sessionHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRING) {\n        this.catalogName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRING) {\n        this.schemaName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 4:\n      if (ftype == Thrift.Type.STRING) {\n        this.functionName = input.readString();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetFunctionsReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetFunctionsReq');\n  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {\n    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);\n    this.sessionHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.catalogName !== null && this.catalogName !== undefined) {\n    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);\n    output.writeString(this.catalogName);\n    output.writeFieldEnd();\n  }\n  if (this.schemaName !== null && this.schemaName !== undefined) {\n    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);\n    output.writeString(this.schemaName);\n    output.writeFieldEnd();\n  }\n  if (this.functionName !== null && this.functionName !== undefined) {\n    output.writeFieldBegin('functionName', Thrift.Type.STRING, 4);\n    output.writeString(this.functionName);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetFunctionsResp = module.exports.TGetFunctionsResp = function(args) {\n  this.status = null;\n  this.operationHandle = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetFunctionsResp.prototype = {};\nTGetFunctionsResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetFunctionsResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetFunctionsResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetOperationStatusReq = module.exports.TGetOperationStatusReq = function(args) {\n  this.operationHandle = null;\n  if (args) {\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetOperationStatusReq.prototype = {};\nTGetOperationStatusReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetOperationStatusReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetOperationStatusReq');\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetOperationStatusResp = module.exports.TGetOperationStatusResp = function(args) {\n  this.status = null;\n  this.operationState = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.operationState !== undefined) {\n      this.operationState = args.operationState;\n    }\n  }\n};\nTGetOperationStatusResp.prototype = {};\nTGetOperationStatusResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.operationState = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetOperationStatusResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetOperationStatusResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.operationState !== null && this.operationState !== undefined) {\n    output.writeFieldBegin('operationState', Thrift.Type.I32, 2);\n    output.writeI32(this.operationState);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCancelOperationReq = module.exports.TCancelOperationReq = function(args) {\n  this.operationHandle = null;\n  if (args) {\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTCancelOperationReq.prototype = {};\nTCancelOperationReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCancelOperationReq.prototype.write = function(output) {\n  output.writeStructBegin('TCancelOperationReq');\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCancelOperationResp = module.exports.TCancelOperationResp = function(args) {\n  this.status = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n  }\n};\nTCancelOperationResp.prototype = {};\nTCancelOperationResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCancelOperationResp.prototype.write = function(output) {\n  output.writeStructBegin('TCancelOperationResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCloseOperationReq = module.exports.TCloseOperationReq = function(args) {\n  this.operationHandle = null;\n  if (args) {\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTCloseOperationReq.prototype = {};\nTCloseOperationReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCloseOperationReq.prototype.write = function(output) {\n  output.writeStructBegin('TCloseOperationReq');\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TCloseOperationResp = module.exports.TCloseOperationResp = function(args) {\n  this.status = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n  }\n};\nTCloseOperationResp.prototype = {};\nTCloseOperationResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTCloseOperationResp.prototype.write = function(output) {\n  output.writeStructBegin('TCloseOperationResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetResultSetMetadataReq = module.exports.TGetResultSetMetadataReq = function(args) {\n  this.operationHandle = null;\n  if (args) {\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n  }\n};\nTGetResultSetMetadataReq.prototype = {};\nTGetResultSetMetadataReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 0:\n        input.skip(ftype);\n        break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetResultSetMetadataReq.prototype.write = function(output) {\n  output.writeStructBegin('TGetResultSetMetadataReq');\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TGetResultSetMetadataResp = module.exports.TGetResultSetMetadataResp = function(args) {\n  this.status = null;\n  this.schema = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.schema !== undefined) {\n      this.schema = args.schema;\n    }\n  }\n};\nTGetResultSetMetadataResp.prototype = {};\nTGetResultSetMetadataResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.schema = new ttypes.TTableSchema();\n        this.schema.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTGetResultSetMetadataResp.prototype.write = function(output) {\n  output.writeStructBegin('TGetResultSetMetadataResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.schema !== null && this.schema !== undefined) {\n    output.writeFieldBegin('schema', Thrift.Type.STRUCT, 2);\n    this.schema.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TFetchResultsReq = module.exports.TFetchResultsReq = function(args) {\n  this.operationHandle = null;\n  this.orientation = 0;\n  this.maxRows = null;\n  if (args) {\n    if (args.operationHandle !== undefined) {\n      this.operationHandle = args.operationHandle;\n    }\n    if (args.orientation !== undefined) {\n      this.orientation = args.orientation;\n    }\n    if (args.maxRows !== undefined) {\n      this.maxRows = args.maxRows;\n    }\n  }\n};\nTFetchResultsReq.prototype = {};\nTFetchResultsReq.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.operationHandle = new ttypes.TOperationHandle();\n        this.operationHandle.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.I32) {\n        this.orientation = input.readI32();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.I64) {\n        this.maxRows = input.readI64();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTFetchResultsReq.prototype.write = function(output) {\n  output.writeStructBegin('TFetchResultsReq');\n  if (this.operationHandle !== null && this.operationHandle !== undefined) {\n    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);\n    this.operationHandle.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.orientation !== null && this.orientation !== undefined) {\n    output.writeFieldBegin('orientation', Thrift.Type.I32, 2);\n    output.writeI32(this.orientation);\n    output.writeFieldEnd();\n  }\n  if (this.maxRows !== null && this.maxRows !== undefined) {\n    output.writeFieldBegin('maxRows', Thrift.Type.I64, 3);\n    output.writeI64(this.maxRows);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nvar TFetchResultsResp = module.exports.TFetchResultsResp = function(args) {\n  this.status = null;\n  this.hasMoreRows = null;\n  this.results = null;\n  if (args) {\n    if (args.status !== undefined) {\n      this.status = args.status;\n    }\n    if (args.hasMoreRows !== undefined) {\n      this.hasMoreRows = args.hasMoreRows;\n    }\n    if (args.results !== undefined) {\n      this.results = args.results;\n    }\n  }\n};\nTFetchResultsResp.prototype = {};\nTFetchResultsResp.prototype.read = function(input) {\n  input.readStructBegin();\n  while (true)\n  {\n    var ret = input.readFieldBegin();\n    var fname = ret.fname;\n    var ftype = ret.ftype;\n    var fid = ret.fid;\n    if (ftype == Thrift.Type.STOP) {\n      break;\n    }\n    switch (fid)\n    {\n      case 1:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.status = new ttypes.TStatus();\n        this.status.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 2:\n      if (ftype == Thrift.Type.BOOL) {\n        this.hasMoreRows = input.readBool();\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      case 3:\n      if (ftype == Thrift.Type.STRUCT) {\n        this.results = new ttypes.TRowSet();\n        this.results.read(input);\n      } else {\n        input.skip(ftype);\n      }\n      break;\n      default:\n        input.skip(ftype);\n    }\n    input.readFieldEnd();\n  }\n  input.readStructEnd();\n  return;\n};\n\nTFetchResultsResp.prototype.write = function(output) {\n  output.writeStructBegin('TFetchResultsResp');\n  if (this.status !== null && this.status !== undefined) {\n    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);\n    this.status.write(output);\n    output.writeFieldEnd();\n  }\n  if (this.hasMoreRows !== null && this.hasMoreRows !== undefined) {\n    output.writeFieldBegin('hasMoreRows', Thrift.Type.BOOL, 2);\n    output.writeBool(this.hasMoreRows);\n    output.writeFieldEnd();\n  }\n  if (this.results !== null && this.results !== undefined) {\n    output.writeFieldBegin('results', Thrift.Type.STRUCT, 3);\n    this.results.write(output);\n    output.writeFieldEnd();\n  }\n  output.writeFieldStop();\n  output.writeStructEnd();\n  return;\n};\n\nttypes.PRIMITIVE_TYPES = [0,1,2,3,4,5,6,7,8,9,15];\nttypes.COMPLEX_TYPES = [10,11,12,13,14];\nttypes.COLLECTION_TYPES = [10,11];\nttypes.TYPE_NAMES = {0 : 'BOOLEAN',\n1 : 'TINYINT',\n2 : 'SMALLINT',\n3 : 'INT',\n4 : 'BIGINT',\n5 : 'FLOAT',\n6 : 'DOUBLE',\n7 : 'STRING',\n8 : 'TIMESTAMP',\n9 : 'BINARY',\n10 : 'ARRAY',\n11 : 'MAP',\n12 : 'STRUCT',\n13 : 'UNIONTYPE',\n15 : 'DECIMAL'\n};\n"
  },
  {
    "path": "lib/shib/engines/hiveserver2/index.js",
    "content": "var thrift = require('node-thrift')\n  , ttransport = require('node-thrift/lib/thrift/transport')\n  , TCLIService = require('./TCLIService')\n  , TTypes = require('./TCLIService_types');\nvar bignumber = require('bignumber.js');\n\n/* HiveServer2 Monitor is disabled in engine.js\n *\n * HiveServer's ExecuteStatement blocks until query finishes.\n *   ExecuteStatement returns operationHandle, and\n *   CancelOperation needs operationHandle.\n *  => We cannot monitor/cancel running ExecuteStatement operations ....\n */\n\nvar MaxRows = 100000;\n\nvar QueryStatusPollingInterval = 5000 // 5sec\n  , OperationStatusPollingInterval = 300; // 0.3sec\n\nvar runningOperations = {}; // For Monitor methods\n\nvar NotSupportedOptionError = exports.NotSupportedOptionError = function(){};\n\nvar Executer = exports.Executer = function(conf, logger){\n  if (conf.name !== 'hiveserver2')\n    throw \"executer name mismatch for hiveserver2:\" + conf.name;\n\n  this.logger = logger;\n\n  /* hive.server2.authentication='NOSASL' or SASLTransport ... */\n  this._connection = thrift.createConnection(\n    conf.host,\n    conf.port,\n    {transport: ttransport.TBufferedTransport}\n  );\n  this._username = conf.username;\n  this._password = conf.password || 'pass'; //TODO: this is not used for NOSASL transport\n  this._client = thrift.createClient(TCLIService, this._connection);\n  this._sessionHandle = null;\n  this._maxRows = conf['maxRows'] || MaxRows;\n};\n\nExecuter.prototype._inSession = function(callback){\n  if (this._sessionHandle) {\n    callback(null); return;\n  }\n  var self = this;\n  var openSessionReq = new TTypes.TOpenSessionReq({username: this._username, password: this._password});\n  this._client.OpenSession(openSessionReq, function(err, res){\n    if (err) { callback(err); return; }\n    if (! res.sessionHandle){ callback({message: \"sessionHandle missing without any reason\"}); return; }\n    self._sessionHandle = res.sessionHandle;\n    callback(null);\n  });\n};\n\nExecuter.prototype.end = function(){\n  if (this._client) {\n    var self = this;\n    if (! this._sessionHandle) {\n      this._connection.end();\n      return;\n    }\n    var closeReq = new TTypes.TCloseSessionReq({sessionHandle: this._sessionHandle});\n    this._client.CloseSession(closeReq, function(){ self._connection.end(); });\n  }\n};\n\nExecuter.prototype.supports = function(operation){\n  switch (operation) {\n  case 'jobname':\n  case 'setup':\n  case 'databases':\n  case 'tables':\n  case 'partitions':\n  case 'describe':\n  case 'execute':\n    return true;\n  }\n  throw \"unknown operation name (for hiveserver2.Executer):\" + operation;\n};\n\nExecuter.prototype.jobname = function(queryid){\n  return 'shib-hs2-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  if (!setups || setups.length < 1) {\n    callback(null); return;\n  }\n\n  var self = this;\n  var client = this._client;\n  var setupQueue = setups.concat(); // shallow copy of Array to use as queue\n\n  var executeSetup = function(queue, callback){\n    var q = queue.shift();\n    // Executer.prototype.execute = function(jobname, dbname, query, callback){ ... }\n    self.execute(null, null, q, function(err, fetcher){\n      if (err) { callback(err); return; }\n\n      fetcher.waitInterval = OperationStatusPollingInterval;\n      fetcher.fetch(null,function(err,rows){\n        if (err) { callback(err); return; }\n        if (queue.length > 0)\n          executeSetup(queue, callback);\n        else\n          callback(null);\n      });\n    });\n  };\n\n  this._inSession(function(err){\n    if (err){ callback(err); return; }\n    executeSetup(setupQueue, callback);\n  });\n};\n\nExecuter.prototype.databases = function(callback){\n  var self = this;\n  var client = this._client;\n  this._inSession(function(err){\n    if (err) { callback(err); return; }\n    // TGetSchemasReq(sessionHandle, catalogName, schemaName)\n    var reqSpec = {sessionHandle:self._sessionHandle};\n    var req = new TTypes.TGetSchemasReq(reqSpec);\n\n    client.GetSchemas(req, function(err, res){\n      if (err) { callback(err); return; }\n      if (! res['operationHandle']) {\n        self.logger.error(\"operationHandle missing for schemas\");\n        callback({message:\"operationHandle missing for schemas\"});\n        return;\n      }\n      // fetch operation fesult\n      var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);\n      fetcher.fetch(null, function(err, result){\n        if (err) { callback(err); return; }\n        var dbnames = result.map(function(line){ return line.split('\\t')[0]; }); // DBNAME\\tCATALOG ?\n        callback(null, dbnames);\n      });\n    });\n  });\n};\n\n\nExecuter.prototype.tables = function(dbname, callback){\n  var self = this;\n  var client = this._client;\n\n  this._inSession(function(err){\n    if (err) { callback(err); return; }\n    // TGetTablesReq(sessionHandle, catalogName, schemaName, tableName, tableTypes)\n    var reqSpec = {sessionHandle:self._sessionHandle};\n    if (dbname && dbname !== '')\n      reqSpec['schemaName'] = dbname;\n    var req = new TTypes.TGetTablesReq(reqSpec);\n\n    client.GetTables(req, function(err, res){\n      if (err) { callback(err); return; }\n      if (! res['operationHandle']) {\n        self.logger.error(\"operationHandle missing for tables\");\n        callback({message:\"operationHandle missing for tables\"});\n        return;\n      }\n      // fetch operation fesult\n      var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);\n      fetcher.fetch(null, function(err, result){\n        if (err) { callback(err); return; }\n        /*\n         * catalog(?), dbname, tablename, tabletype, remarks(comment)\n        var result = [\n          '\\tdefault\\taccess_log\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\tapplog\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\tapplogdev\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\thourly_log\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\tpageviews\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\takamai\\tMANAGED_TABLE\\tNULL',\n          '\\tdefault\\takamai_tmp\\tMANAGED_TABLE\\tNULL'\n        ];\n         */\n        var tables = result.map(function(line){ return line.split('\\t')[2]; });\n        callback(null, tables);\n      });\n    });\n  });\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  var self = this;\n  var client = this._client;\n\n  var statement = 'show partitions ' + tablename;\n  this.execute(null, dbname, statement, function(err, fetcher){\n    if (err) { callback(err); return; }\n    fetcher.waitInterval = OperationStatusPollingInterval;\n    fetcher.fetch(null, function(err, result){\n      if (err) { callback(err); return; }\n      callback(null, result);\n    });\n  });\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  var self = this;\n  var client = this._client;\n\n  this._inSession(function(err){\n    if (err) { callback(err); return; }\n    // TGetColumnsReq(sessionHandle, catalogName, schemaName, tableName, columnName)\n    var reqSpec = {sessionHandle:self._sessionHandle, tableName:tablename};\n    if (dbname && dbname !== '')\n      reqSpec['schemaName'] = dbname;\n    var req = new TTypes.TGetColumnsReq(reqSpec);\n    client.GetColumns(req, function(err, res){\n      if (err) { callback(err); return; }\n      if (! res['operationHandle']) {\n        self.logger.error(\"operationHandle missing for describe\");\n        callback({message:\"operationHandle missing for describe\"});\n        return;\n      }\n      // fetch operation fesult\n      var fetcher = new Fetcher(client, null, res.operationHandle, self._maxRows);\n      fetcher.fetch(null, function(err, result){\n        if (err) { callback(err); return; }\n        /*\n         * result: array of string, tab separated values of these.\nNULL default logs hhmmss   12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL  1 YES NULL NULL NULL NULL NO\nNULL default logs vhost    12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL  2 YES NULL NULL NULL NULL NO\nNULL default logs path     12   STRING 2147483647 NULL NULL NULL 1 with query NULL NULL NULL NULL  3 YES NULL NULL NULL NULL NO\nNULL default logs method   12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL  4 YES NULL NULL NULL NULL NO\nNULL default logs status    5 SMALLINT          5 NULL    0   10 1       NULL NULL NULL NULL NULL  5 YES NULL NULL NULL NULL NO\nNULL default logs bytes    -5   BIGINT         19 NULL    0   10 1       NULL NULL NULL NULL NULL  6 YES NULL NULL NULL NULL NO\nNULL default logs duration -5   BIGINT         19 NULL    0   10 1  micro sec NULL NULL NULL NULL  7 YES NULL NULL NULL NULL NO\nNULL default logs referer  12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL  8 YES NULL NULL NULL NULL NO\nNULL default logs rhost    12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL  9 YES NULL NULL NULL NULL NO\nNULL default logs agent    12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL 10 YES NULL NULL NULL NULL NO\nNULL default logs flag     16  BOOLEAN       NULL NULL    0 NULL 1  pageviews NULL NULL NULL NULL 11 YES NULL NULL NULL NULL NO\nNULL default logs service  12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL 12 YES NULL NULL NULL NULL NO\nNULL default logs yyyymmdd 12   STRING 2147483647 NULL NULL NULL 1       NULL NULL NULL NULL NULL 13 YES NULL NULL NULL NULL NO\n\n(0)catalog, (1)schema, (2)table, (3)field, (4)typeNum?, (5)type, (6)maxChars?, (7)NULL,\n(8)?, (9)?, (10)1(?), (11)comment, (12-15)NULL, (16)index, (17)YES(nullable?), (18-21)NULL, (22)NO?\n         */\n        var fields = result.map(function(row){\n          var cols = row.split('\\t');\n          return [ cols[3], cols[5], (cols[11] === 'NULL' ? '' : cols[11]) ];\n        });\n        callback(null, fields);\n      });\n    });\n  });\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  var self = this;\n  var client = this._client;\n\n  /* confOverlay argument of TExecuteStatementReq doesn't works with 'mapred.job.name' and 'mapreduce.job.name' ... */\n  var setups = [];\n  if (dbname && dbname !== '') {\n    setups.push('use ' + dbname);\n  }\n  if (jobname && jobname !== '') {\n    setups.push('set mapred.job.name=' + jobname);\n    setups.push('set mapreduce.job.name=' + jobname);\n  }\n  this._inSession(function(err){\n    if (err) { callback(err); return; }\n    self.setup(setups, function(err){\n      if (err) { callback(err); return; }\n      var executeReq = new TTypes.TExecuteStatementReq({sessionHandle:self._sessionHandle, statement:query});\n      client.ExecuteStatement(executeReq, function(err, res){\n        if (err) { callback(err); return; }\n        /*\nttypes.TStatusCode = {\n'SUCCESS_STATUS' : 0,\n'SUCCESS_WITH_INFO_STATUS' : 1,\n'STILL_EXECUTING_STATUS' : 2,\n'ERROR_STATUS' : 3,\n'INVALID_HANDLE_STATUS' : 4\n};\nttypes.TOperationState = {\n'INITIALIZED_STATE' : 0,\n'RUNNING_STATE' : 1,\n'FINISHED_STATE' : 2,\n'CANCELED_STATE' : 3,\n'CLOSED_STATE' : 4,\n'ERROR_STATE' : 5,\n'UKNOWN_STATE' : 6\n};\n         */\n        if (!res || !res['status'] || res.status['statusCode'] !== TTypes.TStatusCode['SUCCESS_STATUS']) {\n          self.logger.warn(\"Failed to execute statement\", {query:query, res:res});\n          callback({message:\"Failed to execute statement:\" + res.status.errorMessage});\n          /*\n          var resExample1 = { status:\n            { statusCode: 3,\n              infoMessages: null,\n              sqlState: '08S01',\n              errorCode: 1,\n              errorMessage: 'Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask' },\n            operationHandle: null\n          };\n           */\n          return;\n        }\n        if (! res['operationHandle']) {\n          self.logger.error(\"operationHandle missing for query\");\n          callback({message:\"operationHandle missing for query\"});\n          return;\n        }\n        if (jobname)\n          runningOperations[jobname] = {jobname: jobname, handle: res.operationHandle, startedAt: new Date()};\n        var fetcher = new Fetcher(client, jobname, res.operationHandle, self._maxRows);\n        fetcher.waitInterval = QueryStatusPollingInterval;\n        callback(null, fetcher);\n      });\n    });\n  });\n};\n\nvar Fetcher = function(client, jobname, operationHandle, maxRows){\n  this._client = client;\n  this._jobname = jobname;\n  this._oph = operationHandle;\n  this._opStatus = null;\n  this._noMoreResults = false;\n  this._maxRows = maxRows;\n\n  this.waitInterval = OperationStatusPollingInterval;\n\n  this._typeName = function(num) {\n    // ttypes.TTypeId = {\n    switch (num) {\n      case  0: return 'boolean'; // 'BOOLEAN_TYPE' : 0,\n      case  1: return 'tinyint'; // 'TINYINT_TYPE' : 1,\n      case  2: return 'smallint'; // 'SMALLINT_TYPE' : 2,\n      case  3: return 'int'; // 'INT_TYPE' : 3,\n      case  4: return 'bigint'; // 'BIGINT_TYPE' : 4,\n      case  5: return 'float'; // 'FLOAT_TYPE' : 5,\n      case  6: return 'double'; // 'DOUBLE_TYPE' : 6,\n      case  7: return 'string'; // 'STRING_TYPE' : 7,\n      case  8: return 'timestamp'; // 'TIMESTAMP_TYPE' : 8,\n      case  9: return 'binary'; // 'BINARY_TYPE' : 9,\n      case 10: return 'array'; // 'ARRAY_TYPE' : 10,\n      case 11: return 'map'; // 'MAP_TYPE' : 11,\n      case 12: return 'struct'; // 'STRUCT_TYPE' : 12,\n      case 13: return 'union'; // 'UNION_TYPE' : 13,\n      case 14: return 'userdefined'; // 'USER_DEFINED_TYPE' : 14,\n      case 15: return 'decimal'; // 'DECIMAL_TYPE' : 15\n    }\n    // };\n    return \"unknown(\" + String(num) + \")\";\n  };\n\n  this.schema = function(callback){\n    var self = this;\n    var req = new TTypes.TGetResultSetMetadataReq({operationHandle: this._oph});\n    this._client.GetResultSetMetadata(req, function(err,res){\n      if (err) { callback(err); return; }\n\n      //TODO: res.status ?\n      var result = res.schema.columns.map(function(c){\n        var colname = c.columnName;\n        var coltypeNum = c.typeDesc[\"types\"][0][\"primitiveEntry\"][\"type\"];\n        return {name:colname, type:self._typeName(coltypeNum)};\n      });\n      callback(null, result);\n/* res.schema\n{\n  \"columns\": [\n    { \"columnName\": \"service\",\n      \"typeDesc\": {\n        \"types\": [\n          { \"primitiveEntry\": { \"type\": 7 },\n            \"arrayEntry\": null,\n            \"mapEntry\": null,\n            \"structEntry\": null,\n            \"unionEntry\": null,\n            \"userDefinedTypeEntry\": null }\n        ]\n      },\n      \"position\": 1,\n      \"comment\": null\n    },\n    { \"columnName\": \"cnt\",\n      \"typeDesc\": {\n        \"types\": [\n          { \"primitiveEntry\": { \"type\": 4 },\n            \"arrayEntry\": null,\n            \"mapEntry\": null,\n            \"structEntry\": null,\n            \"unionEntry\": null,\n            \"userDefinedTypeEntry\": null\n          }\n        ]\n      },\n      \"position\": 2,\n      \"comment\": null\n    }\n  ]\n}\n */\n\n    });\n  };\n\n  // stringify value of each columns\n  this._colValue = function(obj) {\n    /*\n    colVals = [\n      { \"boolVal\": null, \"byteVal\": null, \"i16Val\": null, \"i32Val\": null, \"i64Val\": null, \"doubleVal\": null,\n        \"stringVal\": { \"value\": \"blog\" } },\n      { \"boolVal\": null, \"byteVal\": null, \"i16Val\": null, \"i32Val\": null,\n        \"i64Val\": { \"value\": { \"buffer\": [0, 0, 0, 0, 63, 218, 72, 34], \"offset\": 0 } },\n        \"doubleVal\": null, \"stringVal\": null },\n      { \"boolVal\": { \"value\": false },\n        \"byteVal\": null, \"i16Val\": null, \"i32Val\": null, \"i64Val\": null, \"doubleVal\": null, \"stringVal\": null },\n      { \"boolVal\": null, \"byteVal\": null, \"i16Val\": null, \"i32Val\": null, \"i64Val\": null,\n        \"doubleVal\": { \"value\": 0.01 },\n        \"stringVal\": null },\n      { \"boolVal\": null, \"byteVal\": null, \"i16Val\": null,\n        \"i32Val\": { \"value\": 1 },\n        \"i64Val\": null, \"doubleVal\": null, \"stringVal\": null },\n      { \"boolVal\": null, \"byteVal\": null, \"i16Val\": null, \"i32Val\": null, \"i64Val\": null, \"doubleVal\": null,\n        \"stringVal\": { \"value\": \"[1, 2, 3]\" } }\n    ]\n     */\n    var value = null;\n\n    var non_null_checker = function(object, typef) {\n      if (obj[typef]) {\n        var v = obj[typef]['value'];\n        if (v !== null && v !== undefined)\n          return true;\n      }\n      return false;\n    };\n\n    if (non_null_checker(obj, 'stringVal'))\n      return obj.stringVal.value;\n\n    if (non_null_checker(obj, 'boolVal'))\n      return String(obj.boolVal.value).toUpperCase();\n\n    // rest are numerics, or NULL\n    // byteVal, i16Val, i32Val, i64Val, doubleVal\n\n    if (non_null_checker(obj, 'i64Val')) // i64Val is instanceof node-int64\n      value = new bignumber(obj.i64Val.value.buffer.toString('hex'), 16);\n    else if (non_null_checker(obj, 'i32Val'))\n      value = obj.i32Val.value;\n    else if (non_null_checker(obj, 'i16Val'))\n      value = obj.i16Val.value;\n    else if (non_null_checker(obj, 'doubleVal'))\n      value = obj.doubleVal.value;\n    else if (non_null_checker(obj, 'byteVal'))\n      value = obj.byteVal.value;\n\n    if (value === null)\n      return 'NULL';\n\n    return value;\n  };\n\n  this.fetch = function(num, callback){\n    if (!num) {\n      this._fetchAll(callback);\n      return;\n    }\n\n    var fetchNum = num;\n    if (fetchNum > this._maxRows)\n      fetchNum = this._maxRows;\n\n    if (this._noMoreResults) {\n      callback(null, null);\n      this._closeOperation();\n      return;\n    }\n\n    var self = this;\n    this._waitComplete(function(err){\n      if (err) {\n        callback(err);\n        self._closeOperation();\n        return;\n      }\n      /*\n       ttypes.TFetchOrientation = {\n         'FETCH_NEXT' : 0,\n         'FETCH_PRIOR' : 1,\n         'FETCH_RELATIVE' : 2,\n         'FETCH_ABSOLUTE' : 3,\n         'FETCH_FIRST' : 4,\n         'FETCH_LAST' : 5\n       };\n      */\n      var orientation = TTypes.TFetchOrientation['FETCH_NEXT'];\n      var req = new TTypes.TFetchResultsReq({operationHandle:self._oph, orientation:orientation, maxRows:num});\n      self._client.FetchResults(req, function(err, res){\n        if (err) {\n          if (res['status'])\n            self.logger.error('error for fetch result', res.status);\n          callback(err);\n          self._closeOperation();\n          return;\n        }\n        /*\n        \"status\": {\n          \"statusCode\": 0,\n          \"infoMessages\": null,\n          \"sqlState\": null,\n          \"errorCode\": null,\n          \"errorMessage\": null\n        },\n        \"hasMoreRows\": false,\n        \"results\": {\n          \"startRowOffset\": { \"buffer\": [0,0,0,0,0,0,0,0], \"offset\": 0 },\n          \"rows\": [\n            { \"colVals\": [ ... ] },\n            { \"colVals\": [ ... ] }\n          ],\n          \"columns\": null\n        }\n         */\n        /* hasMoreRows is always false !!!!!!!!!!!!!!!! */\n        var fetchedRows = res.results && res.results.rows || [];\n        var fetchedLength = fetchedRows.length;\n        var rows = [];\n\n        if (fetchedLength < 1) {\n          self._noMoreResults = true;\n        } else {\n          for (var i = 0; i < fetchedLength; i++) {\n            var cols = [];\n            var colVals = fetchedRows[i].colVals;\n            var colValsLength = colVals.length;\n            for (var j = 0; j < colValsLength; j++) {\n              cols.push(self._colValue(colVals[j]));\n            }\n            rows.push(cols.join(\"\\t\"));\n          }\n        }\n        callback(null, rows);\n      });\n    });\n  };\n\n  this._fetchAll = function(callback){\n    var r = [];\n    var self = this;\n    var fetcher = function(){\n      self.fetch(self._maxRows, function(err, results){\n        if (err) { callback(err); return; }\n        if (results === null || results.length < 1 || results.length === 1 && results[0].length < 1) {\n          callback(null, r);\n          return;\n        }\n        r = r.concat(results);\n        fetcher();\n      });\n    };\n    fetcher();\n  };\n\n  this._closeOperation = function(callback){\n    var req = new TTypes.TCloseOperationReq({operationHandle: this._oph});\n    if (this._jobname)\n      delete runningOperations[this._jobname];\n    client.CloseOperation(req, function(err, res){\n      if (callback) {\n        callback();\n      }\n    });\n  };\n\n  this._waitComplete = function(callback){\n    if (this._opStatus !== null) {\n      callback(null);\n      return;\n    }\n\n    var self = this;\n    var oph = this._oph;\n    var client = this._client;\n    var poller = function(){\n      var req = new TTypes.TGetOperationStatusReq({operationHandle: oph});\n      client.GetOperationStatus(req, function(err,res){\n        if (err) { callback(err); return; }\n/*\nttypes.TStatusCode = {\n'SUCCESS_STATUS' : 0,\n'SUCCESS_WITH_INFO_STATUS' : 1,\n'STILL_EXECUTING_STATUS' : 2,\n'ERROR_STATUS' : 3,\n'INVALID_HANDLE_STATUS' : 4\n};\nttypes.TOperationState = {\n'INITIALIZED_STATE' : 0,\n'RUNNING_STATE' : 1,\n'FINISHED_STATE' : 2,\n'CANCELED_STATE' : 3,\n'CLOSED_STATE' : 4,\n'ERROR_STATE' : 5,\n'UKNOWN_STATE' : 6\n};\n */\n        var statusCode = res && res['operationState'];\n        if (statusCode === TTypes.TOperationState['INITIALIZED_STATE'] ||\n            statusCode === TTypes.TOperationState['RUNNING_STATE']) {\n          setTimeout(poller, this.waitInterval);\n          return;\n        }\n\n        self._opStatus = statusCode;\n        if (statusCode === TTypes.TOperationState['FINISHED_STATE']) {\n          callback(null);\n          return;\n        }\n\n        var msg;\n        if (statusCode === TTypes.TOperationState['CANCELED_STATE'])\n          msg = 'Query canceled';\n        else if (statusCode === TTypes.TOperationState['CLOSED_STATE'])\n          msg = 'Query closed';\n        else if (statusCode === TTypes.TOperationState['ERROR_STATE'])\n          msg = 'Query process ended with errror';\n        else if (statusCode === TTypes.TOperationState['UNKNOWN_STATE'])\n          msg = 'Query status unknown';\n        else\n          msg = 'Statement failed with unknown status:' + ' (' + String(statusCode) + ')';\n\n        callback({message:msg, status:res.status});\n        return;\n      });\n    };\n    poller();\n  };\n};\n"
  },
  {
    "path": "lib/shib/engines/huahin_mrv1/index.js",
    "content": "var RESTClient = require('./rest').Client;\n\nvar Monitor = exports.Monitor = function(conf, logger) {\n  if (conf.name !== 'huahin_mrv1')\n    throw \"monitor name mismatch for huahin_mrv1:\" + conf.name;\n\n  this.logger = logger;\n  this._client = new RESTClient(conf.host, conf.port);\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) {\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for huahin_mrv1.Monitor):\" + operation;\n};\n\nfunction convertStatus(status) {\n   // detail status object by huahin manager 0.2.2 mrv1\n  /*\n  var data = {\n    configuration: {\n     // job configuration properties. for full list, see end of this file\n     // ...\n     'hive.query.id': 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',\n     'hive.query.string':\n      '--- 3578d8d4 SELECT count(*) AS cnt FROM access_log WHERE (service=\\'blog\\' OR service=\\'blogimg\\') AND yyyymmdd=\\'20130410\\'',\n    },\n    groups:\n    { 'File System Counters': [Object],\n      'Job Counters ': [Object],\n      'Map-Reduce Framework': [Object],\n      'org.apache.hadoop.hive.ql.exec.MapOperator$Counter': [Object],\n      'org.apache.hadoop.mapreduce.lib.input.FileInputFormatCounter': [Object] },\n    jobid: 'job_201304011701_1912',\n    name: 'shib-3578d8d4f5a1812de7a7714f5b108776',\n    state: 'RUNNING',\n    priority: 'NORMAL',\n    mapComplete: '89.014534%',\n    reduceComplete: '29.147774%',\n    schedulingInfo: 'NA',\n    startTime: 'Thu Apr 11 16:06:40 JST 2013',\n    trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',\n    jobFile: 'hdfs://namenodehaclustername/mapred/staging/hive/.staging/job_201304011701_1912/job.xml',\n    user: 'hive' }\n  */\n  /*\n  var returnedValus = {\n    jobid: 'job_201304011701_1912',\n    name: 'shib-3578d8d4f5a1812de7a7714f5b108776',\n    priority: 'NORMAL',\n    state: 'RUNNING',\n    trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',\n    startTime: 'Thu Apr 11 2013 16:06:40 (JST)',\n    mapComplete: 89,\n    reduceComplete: 29,\n    hiveQueryId: 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',\n    hiveQueryString: 'SELECT ...'\n  };\n   */\n  if (status === undefined) {\n    return null;\n  }\n  var retval = {};\n\n  retval['jobid'] = status['jobid'];\n  retval['name'] = status['name'];\n  retval['priority'] = status['priority'];\n  retval['state'] = status['state'];\n  retval['trackingURL'] = status['trackingURL'];\n\n  retval['startTime'] = (function(sourceDate){\n    // convert for `new Date(string)` acceptable format\n    // 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'\n\n    // [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year\n    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);\n    if (! match) { return null; }\n    // -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)\n    return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');\n  })(status['startTime']);\n\n  retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);\n  retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);\n\n  retval['hiveQueryId'] = (status['configuration'] || {})['hive.query.id'];\n  retval['hiveQueryString'] = (status['configuration'] || {})['hive.query.string'];\n\n  return retval;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  var client = this._client;\n  client.listAll(function(err, result){\n    if (err || !result) { callback(err, null); return; }\n\n    var jobid = null;\n    result.forEach(function(job){\n      if (job.name === jobname)\n        jobid = job.jobid;\n    });\n    if (!jobid) { callback(null, null); return; }\n\n    client.detail(jobid, function(err, data){\n      if (err) { callback(err); return; }\n      callback(null, convertStatus(data));\n    });\n  });\n};\n\nMonitor.prototype.kill = function(jobid, callback){\n  this._client.kill(jobid, callback);\n};\n\n/*\n  { 'datanucleus.autoCreateSchema': 'true',\n    'datanucleus.autoCreateTables': 'true',\n    'datanucleus.autoStartMechanismMode': 'checked',\n    'datanucleus.cache.level2': 'false',\n    'datanucleus.cache.level2.type': 'none',\n    'datanucleus.connectionPoolingType': 'DBCP',\n    'datanucleus.fixedDatastore': 'true',\n    'datanucleus.identifierFactory': 'datanucleus',\n    'datanucleus.plugin.pluginRegistryBundleCheck': 'LOG',\n    'datanucleus.storeManagerType': 'rdbms',\n    'datanucleus.transactionIsolation': 'repeatable-read',\n    'datanucleus.validateColumns': 'false',\n    'datanucleus.validateConstraints': 'false',\n    'datanucleus.validateTables': 'false',\n    'datanucleus.valuegeneration.transactionIsolation': 'repeatable-read',\n    'dfs.block.access.key.update.interval': '600',\n    'dfs.block.access.token.enable': 'false',\n    'dfs.block.access.token.lifetime': '600',\n    'dfs.blockreport.initialDelay': '0',\n    'dfs.blockreport.intervalMsec': '21600000',\n    'dfs.blocksize': '256m',\n    'dfs.bytes-per-checksum': '512',\n    'dfs.client-write-packet-size': '65536',\n    'dfs.client.block.write.replace-datanode-on-failure.enable': 'true',\n    'dfs.client.block.write.replace-datanode-on-failure.policy': 'DEFAULT',\n    'dfs.client.block.write.retries': '3',\n    'dfs.client.failover.connection.retries': '0',\n    'dfs.client.failover.connection.retries.on.timeouts': '0',\n    'dfs.client.failover.max.attempts': '15',\n    'dfs.client.failover.proxy.provider.namenodehaclustername': 'org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider',\n    'dfs.client.failover.sleep.base.millis': '500',\n    'dfs.client.failover.sleep.max.millis': '15000',\n    'dfs.client.file-block-storage-locations.num-threads': '10',\n    'dfs.client.file-block-storage-locations.timeout': '60',\n    'dfs.client.https.keystore.resource': 'ssl-client.xml',\n    'dfs.client.https.need-auth': 'false',\n    'dfs.client.use.datanode.hostname': 'false',\n    'dfs.datanode.address': '0.0.0.0:50010',\n    'dfs.datanode.balance.bandwidthPerSec': '3145728',\n    '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',\n    'dfs.datanode.data.dir.perm': '700',\n    'dfs.datanode.directoryscan.interval': '21600',\n    'dfs.datanode.directoryscan.threads': '1',\n    'dfs.datanode.dns.interface': 'default',\n    'dfs.datanode.dns.nameserver': 'default',\n    'dfs.datanode.drop.cache.behind.reads': 'false',\n    'dfs.datanode.drop.cache.behind.writes': 'false',\n    'dfs.datanode.du.reserved': '10737418240',\n    'dfs.datanode.failed.volumes.tolerated': '0',\n    'dfs.datanode.handler.count': '10',\n    'dfs.datanode.hdfs-blocks-metadata.enabled': 'true',\n    'dfs.datanode.http.address': '0.0.0.0:50075',\n    'dfs.datanode.https.address': '0.0.0.0:50475',\n    'dfs.datanode.ipc.address': '0.0.0.0:50020',\n    'dfs.datanode.max.transfer.threads': '8192',\n    'dfs.datanode.readahead.bytes': '4193404',\n    'dfs.datanode.sync.behind.writes': 'false',\n    'dfs.datanode.use.datanode.hostname': 'false',\n    'dfs.default.chunk.view.size': '32768',\n    'dfs.domain.socket.path': '/var/run/hadoop-hdfs/dn._PORT',\n    'dfs.encrypt.data.transfer': 'false',\n    'dfs.ha.automatic-failover.enabled': 'false',\n    'dfs.ha.fencing.methods': 'shell(/bin/true)',\n    'dfs.ha.fencing.ssh.connect-timeout': '30000',\n    'dfs.ha.log-roll.period': '120',\n    'dfs.ha.namenodes.namenodehaclustername': 'master01,master02',\n    'dfs.ha.tail-edits.period': '60',\n    'dfs.heartbeat.interval': '3',\n    'dfs.https.enable': 'false',\n    'dfs.https.server.keystore.resource': 'ssl-server.xml',\n    'dfs.image.compress': 'false',\n    'dfs.image.compression.codec': 'org.apache.hadoop.io.compress.DefaultCodec',\n    'dfs.image.transfer.bandwidthPerSec': '0',\n    'dfs.journalnode.edits.dir': '/var/hadoop/disk01/dfs/jn',\n    'dfs.journalnode.http-address': '0.0.0.0:8480',\n    'dfs.journalnode.rpc-address': '0.0.0.0:8485',\n    'dfs.namenode.accesstime.precision': '3600000',\n    'dfs.namenode.audit.loggers': 'default',\n    'dfs.namenode.backup.address': '0.0.0.0:50100',\n    'dfs.namenode.backup.http-address': '0.0.0.0:50105',\n    'dfs.namenode.checkpoint.check.period': '3600',\n    'dfs.namenode.checkpoint.dir': 'file:///var/hadoop/tmp/cache/dfs',\n    'dfs.namenode.checkpoint.edits.dir': 'file:///var/hadoop/tmp/cache/dfs',\n    'dfs.namenode.checkpoint.period': '3600',\n    'dfs.namenode.checkpoint.txns': '40000',\n    'dfs.namenode.decommission.interval': '30',\n    'dfs.namenode.decommission.nodes.per.interval': '5',\n    'dfs.namenode.delegation.key.update-interval': '86400000',\n    'dfs.namenode.delegation.token.max-lifetime': '604800000',\n    'dfs.namenode.delegation.token.renew-interval': '86400000',\n    'dfs.namenode.edits.dir': '${dfs.namenode.name.dir}',\n    'dfs.namenode.edits.journal-plugin.qjournal': 'org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager',\n    'dfs.namenode.fs-limits.max-component-length': '0',\n    'dfs.namenode.fs-limits.max-directory-items': '0',\n    'dfs.namenode.handler.count': '20',\n    'dfs.namenode.http-address': '0.0.0.0:50070',\n    'dfs.namenode.http-address.namenodehaclustername.master01': 'master01.hadoop.local:50070',\n    'dfs.namenode.http-address.namenodehaclustername.master02': 'master02.hadoop.local:50070',\n    'dfs.namenode.https-address': '0.0.0.0:50470',\n    'dfs.namenode.invalidate.work.pct.per.iteration': '0.32f',\n    'dfs.namenode.kerberos.internal.spnego.principal': '${dfs.web.authentication.kerberos.principal}',\n    'dfs.namenode.logging.level': 'info',\n    'dfs.namenode.max.extra.edits.segments.retained': '10000',\n    'dfs.namenode.max.objects': '0',\n    'dfs.namenode.name.dir': 'file:///var/hadoop/disk01/dfs/nn',\n    'dfs.namenode.name.dir.restore': 'false',\n    'dfs.namenode.num.checkpoints.retained': '2',\n    'dfs.namenode.num.extra.edits.retained': '1000000',\n    'dfs.namenode.replication.considerLoad': 'true',\n    'dfs.namenode.replication.interval': '3',\n    'dfs.namenode.replication.min': '1',\n    'dfs.namenode.replication.work.multiplier.per.iteration': '2',\n    'dfs.namenode.rpc-address.namenodeclustername.master01': 'master01.hadoop.local:8020',\n    'dfs.namenode.rpc-address.namenodeclustername.master02': 'master02.hadoop.local:8020',\n    'dfs.namenode.safemode.extension': '30000',\n    'dfs.namenode.safemode.min.datanodes': '0',\n    'dfs.namenode.safemode.threshold-pct': '0.999f',\n    'dfs.namenode.secondary.http-address': '0.0.0.0:50090',\n    'dfs.namenode.shared.edits.dir': 'qjournal://journalnode01.hadoop.local:8485;journalnode02.hadoop.local:8485;journalnode03.hadoop.local:8485/mycluster',\n    'dfs.namenode.support.allow.format': 'true',\n    'dfs.nameservices': 'namenodehaclustername',\n    'dfs.permissions.enabled': 'false',\n    'dfs.permissions.superusergroup': 'hadoop',\n    'dfs.replication': '3',\n    'dfs.replication.max': '512',\n    'dfs.secondary.namenode.kerberos.internal.spnego.principal': '${dfs.web.authentication.kerberos.principal}',\n    'dfs.stream-buffer-size': '4096',\n    'dfs.support.append': 'true',\n    'dfs.webhdfs.enabled': 'true',\n    'file.blocksize': '67108864',\n    'file.bytes-per-checksum': '512',\n    'file.client-write-packet-size': '65536',\n    'file.replication': '1',\n    'file.stream-buffer-size': '4096',\n    'fs.AbstractFileSystem.file.impl': 'org.apache.hadoop.fs.local.LocalFs',\n    'fs.AbstractFileSystem.hdfs.impl': 'org.apache.hadoop.fs.Hdfs',\n    'fs.AbstractFileSystem.viewfs.impl': 'org.apache.hadoop.fs.viewfs.ViewFs',\n    'fs.automatic.close': 'true',\n    'fs.defaultFS': 'hdfs://namenodehaclustername',\n    'fs.df.interval': '60000',\n    'fs.ftp.host': '0.0.0.0',\n    'fs.ftp.host.port': '21',\n    'fs.har.impl': 'org.apache.hadoop.hive.shims.HiveHarFileSystem',\n    'fs.permissions.umask-mode': '022',\n    'fs.s3.block.size': '67108864',\n    'fs.s3.buffer.dir': '${hadoop.tmp.dir}/s3',\n    'fs.s3.maxRetries': '4',\n    'fs.s3.sleepTimeSeconds': '10',\n    'fs.s3n.block.size': '67108864',\n    'fs.trash.checkpoint.interval': '0',\n    'fs.trash.interval': '0',\n    'ftp.blocksize': '67108864',\n    'ftp.bytes-per-checksum': '512',\n    'ftp.client-write-packet-size': '65536',\n    'ftp.replication': '3',\n    'ftp.stream-buffer-size': '4096',\n    'group.name': 'hive',\n    'ha.failover-controller.cli-check.rpc-timeout.ms': '20000',\n    'ha.failover-controller.graceful-fence.connection.retries': '1',\n    'ha.failover-controller.graceful-fence.rpc-timeout.ms': '5000',\n    'ha.failover-controller.new-active.rpc-timeout.ms': '60000',\n    'ha.health-monitor.check-interval.ms': '1000',\n    'ha.health-monitor.connect-retry-interval.ms': '1000',\n    'ha.health-monitor.rpc-timeout.ms': '45000',\n    'ha.health-monitor.sleep-after-disconnect.ms': '1000',\n    'ha.zookeeper.acl': 'world:anyone:rwcda',\n    'ha.zookeeper.parent-znode': '/hadoop-ha',\n    'ha.zookeeper.quorum': 'jornalnode01.hadoop.local,journalnode02.hadoop.local,journalnode03.hadoop.local',\n    'ha.zookeeper.session-timeout.ms': '5000',\n    'hadoop.bin.path': '//usr/lib/hadoop/bin/hadoop',\n    'hadoop.common.configuration.version': '0.23.0',\n    'hadoop.conf.dir': '/etc/hadoop/conf',\n    'hadoop.fuse.connection.timeout': '300',\n    'hadoop.fuse.timer.period': '5',\n    'hadoop.hdfs.configuration.version': '1',\n    'hadoop.http.authentication.kerberos.keytab': '${user.home}/hadoop.keytab',\n    'hadoop.http.authentication.kerberos.principal': 'HTTP/_HOST@LOCALHOST',\n    'hadoop.http.authentication.signature.secret.file': '${user.home}/hadoop-http-auth-signature-secret',\n    'hadoop.http.authentication.simple.anonymous.allowed': 'true',\n    'hadoop.http.authentication.token.validity': '36000',\n    'hadoop.http.authentication.type': 'simple',\n    'hadoop.http.filter.initializers': 'org.apache.hadoop.http.lib.StaticUserWebFilter',\n    'hadoop.http.staticuser.user': 'webuser,webgroup',\n    'hadoop.jetty.logs.serve.aliases': 'true',\n    'hadoop.job.history.location': '/mrv1-history',\n    'hadoop.kerberos.kinit.command': 'kinit',\n    'hadoop.proxyuser.httpfs.groups': '*',\n    'hadoop.proxyuser.httpfs.hosts': '*',\n    'hadoop.relaxed.worker.version.check': 'true',\n    'hadoop.rpc.protection': 'authentication',\n    'hadoop.rpc.socket.factory.class.default': 'org.apache.hadoop.net.StandardSocketFactory',\n    'hadoop.security.authentication': 'simple',\n    'hadoop.security.authorization': 'false',\n    'hadoop.security.group.mapping': 'org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback',\n    'hadoop.security.group.mapping.ldap.search.attr.group.name': 'cn',\n    'hadoop.security.group.mapping.ldap.search.attr.member': 'member',\n    'hadoop.security.group.mapping.ldap.search.filter.group': '(objectClass=group)',\n    'hadoop.security.group.mapping.ldap.search.filter.user': '(&(objectClass=user)(sAMAccountName={0}))',\n    'hadoop.security.group.mapping.ldap.ssl': 'false',\n    'hadoop.security.groups.cache.secs': '300',\n    'hadoop.security.instrumentation.requires.admin': 'false',\n    'hadoop.security.uid.cache.secs': '14400',\n    'hadoop.skip.worker.version.check': 'false',\n    'hadoop.ssl.client.conf': 'ssl-client.xml',\n    'hadoop.ssl.enabled': 'false',\n    'hadoop.ssl.hostname.verifier': 'DEFAULT',\n    'hadoop.ssl.keystores.factory.class': 'org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory',\n    'hadoop.ssl.require.client.cert': 'false',\n    'hadoop.ssl.server.conf': 'ssl-server.xml',\n    'hadoop.tmp.dir': '/var/hadoop/tmp/${user.name}',\n    'hadoop.util.hash.type': 'murmur',\n    'hadoop.work.around.non.threadsafe.getpwuid': 'false',\n    'hive.added.jars.path': 'file:///home/user/woothee.jar,file:///usr/lib/hive/lib/hive-builtins-0.10.0-cdh4.2.0.jar',\n    'hive.archive.enabled': 'false',\n    'hive.archive.har.parentdir.settable': 'true',\n    'hive.auto.convert.join': 'false',\n    'hive.auto.progress.timeout': '0',\n    'hive.autogen.columnalias.prefix.includefuncname': 'false',\n    'hive.autogen.columnalias.prefix.label': '_c',\n    'hive.binary.record.max.length': '1000',\n    'hive.cli.errors.ignore': 'false',\n    'hive.cli.print.current.db': 'false',\n    'hive.cli.print.header': 'false',\n    'hive.cli.prompt': 'hive',\n    'hive.cluster.delegation.token.store.class': 'org.apache.hadoop.hive.thrift.MemoryTokenStore',\n    'hive.cluster.delegation.token.store.zookeeper.znode': '/hive/cluster/delegation',\n    'hive.conf.validation': 'true',\n    'hive.debug.localtask': 'false',\n    'hive.default.fileformat': 'TextFile',\n    'hive.downloaded.resources.dir': '/tmp/hive/hive_resources',\n    'hive.enforce.bucketing': 'false',\n    'hive.enforce.bucketmapjoin': 'false',\n    'hive.enforce.sorting': 'false',\n    'hive.enforce.sortmergebucketmapjoin': 'false',\n    'hive.entity.separator': '@',\n    'hive.error.on.empty.partition': 'false',\n    'hive.exec.compress.intermediate': 'false',\n    'hive.exec.compress.output': 'true',\n    'hive.exec.concatenate.check.index': 'true',\n    'hive.exec.counters.pull.interval': '1000',\n    'hive.exec.default.partition.name': '__HIVE_DEFAULT_PARTITION__',\n    'hive.exec.drop.ignorenonexistent': 'true',\n    'hive.exec.dynamic.partition': 'false',\n    'hive.exec.dynamic.partition.mode': 'strict',\n    'hive.exec.job.debug.capture.stacktraces': 'true',\n    'hive.exec.job.debug.timeout': '30000',\n    'hive.exec.list.bucketing.default.dir': 'HIVE_DEFAULT_LIST_BUCKETING_DIR_NAME',\n    'hive.exec.local.scratchdir': '/tmp/hive',\n    'hive.exec.max.created.files': '100000',\n    'hive.exec.max.dynamic.partitions': '1000',\n    'hive.exec.max.dynamic.partitions.pernode': '100',\n    'hive.exec.mode.local.auto': 'false',\n    'hive.exec.mode.local.auto.input.files.max': '4',\n    'hive.exec.mode.local.auto.inputbytes.max': '134217728',\n    'hive.exec.parallel': 'true',\n    'hive.exec.parallel.thread.number': '8',\n    'hive.exec.perf.logger': 'org.apache.hadoop.hive.ql.log.PerfLogger',\n    'hive.exec.plan': 'hdfs://namenodehaclustername/tmp/hive-hive/hive_2013-04-11_16-06-38_373_6837539457494191559/-mr-10003/ef2e8dfd-6717-4969-a599-42708098c616',\n    'hive.exec.rcfile.use.explicit.header': 'true',\n    'hive.exec.reducers.bytes.per.reducer': '1000000000',\n    'hive.exec.reducers.max': '30',\n    'hive.exec.rowoffset': 'false',\n    'hive.exec.scratchdir': '/tmp/hive-${user.name}',\n    'hive.exec.script.allow.partial.consumption': 'false',\n    'hive.exec.script.maxerrsize': '100000',\n    'hive.exec.script.trust': 'false',\n    'hive.exec.show.job.failure.debug.info': 'true',\n    'hive.exec.submitviachild': 'false',\n    'hive.exec.tasklog.debug.timeout': '20000',\n    'hive.exim.uri.scheme.whitelist': 'hdfs,pfile',\n    'hive.fetch.output.serde': 'org.apache.hadoop.hive.serde2.DelimitedJSONSerDe',\n    'hive.fetch.task.conversion': 'minimal',\n    'hive.fileformat.check': 'true',\n    'hive.groupby.mapaggr.checkinterval': '100000',\n    'hive.groupby.skewindata': 'false',\n    'hive.hadoop.supports.splittable.combineinputformat': 'false',\n    'hive.hashtable.initialCapacity': '100000',\n    'hive.hashtable.loadfactor': '0.75',\n    'hive.hbase.wal.enabled': 'true',\n    'hive.heartbeat.interval': '1000',\n    'hive.hmshandler.force.reload.conf': 'false',\n    'hive.hmshandler.retry.attempts': '1',\n    'hive.hmshandler.retry.interval': '1000',\n    'hive.hwi.listen.host': '0.0.0.0',\n    'hive.hwi.listen.port': '9999',\n    'hive.index.compact.binary.search': 'true',\n    'hive.index.compact.file.ignore.hdfs': 'false',\n    'hive.index.compact.query.max.entries': '10000000',\n    'hive.index.compact.query.max.size': '10737418240',\n    'hive.input.format': 'org.apache.hadoop.hive.ql.io.CombineHiveInputFormat',\n    'hive.input.format.sorted': 'false',\n    'hive.insert.into.external.tables': 'true',\n    'hive.insert.into.multilevel.dirs': 'false',\n    'hive.internal.ddl.list.bucketing.enable': 'false',\n    'hive.jobname.length': '50',\n    'hive.join.cache.size': '25000',\n    'hive.join.emit.interval': '1000',\n    'hive.limit.optimize.enable': 'false',\n    'hive.limit.optimize.fetch.max': '50000',\n    'hive.limit.optimize.limit.file': '10',\n    'hive.limit.row.max.size': '100000',\n    'hive.lock.manager': 'org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager',\n    'hive.lock.mapred.only.operation': 'false',\n    'hive.lock.numretries': '100',\n    'hive.lock.sleep.between.retries': '60',\n    'hive.lockmgr.zookeeper.default.partition.name': '__HIVE_DEFAULT_ZOOKEEPER_PARTITION__',\n    'hive.map.aggr': 'true',\n    'hive.map.aggr.hash.force.flush.memory.threshold': '0.9',\n    'hive.map.aggr.hash.min.reduction': '0.5',\n    'hive.map.aggr.hash.percentmemory': '0.5',\n    'hive.map.groupby.sorted': 'false',\n    'hive.mapjoin.bucket.cache.size': '100',\n    'hive.mapjoin.cache.numrows': '25000',\n    'hive.mapjoin.check.memory.rows': '100000',\n    'hive.mapjoin.followby.gby.localtask.max.memory.usage': '0.55',\n    'hive.mapjoin.followby.map.aggr.hash.percentmemory': '0.3',\n    'hive.mapjoin.localtask.max.memory.usage': '0.9',\n    'hive.mapjoin.size.key': '10000',\n    'hive.mapjoin.smalltable.filesize': '25000000',\n    'hive.mapper.cannot.span.multiple.partitions': 'false',\n    'hive.mapred.local.mem': '0',\n    'hive.mapred.mode': 'nonstrict',\n    'hive.mapred.partitioner': 'org.apache.hadoop.hive.ql.io.DefaultHivePartitioner',\n    'hive.mapred.reduce.tasks.speculative.execution': 'true',\n    'hive.mapred.supports.subdirectories': 'false',\n    'hive.merge.current.job.has.dynamic.partitions': 'false',\n    'hive.merge.input.format.block.level': 'org.apache.hadoop.hive.ql.io.rcfile.merge.RCFileBlockMergeInputFormat',\n    'hive.merge.mapfiles': 'true',\n    'hive.merge.mapredfiles': 'false',\n    'hive.merge.rcfile.block.level': 'true',\n    'hive.merge.size.per.task': '256000000',\n    'hive.merge.smallfiles.avgsize': '16000000',\n    'hive.mergejob.maponly': 'true',\n    'hive.metadata.move.exported.metadata.to.trash': 'true',\n    'hive.metastore.archive.intermediate.archived': '_INTERMEDIATE_ARCHIVED',\n    'hive.metastore.archive.intermediate.extracted': '_INTERMEDIATE_EXTRACTED',\n    'hive.metastore.archive.intermediate.original': '_INTERMEDIATE_ORIGINAL',\n    'hive.metastore.authorization.storage.checks': 'false',\n    'hive.metastore.batch.retrieve.max': '300',\n    'hive.metastore.batch.retrieve.table.partition.max': '1000',\n    'hive.metastore.cache.pinobjtypes': 'Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order',\n    'hive.metastore.client.connect.retry.delay': '1',\n    'hive.metastore.client.socket.timeout': '20',\n    'hive.metastore.connect.retries': '3',\n    'hive.metastore.ds.retry.attempts': '1',\n    'hive.metastore.ds.retry.interval': '1000',\n    'hive.metastore.event.clean.freq': '0',\n    'hive.metastore.event.expiry.duration': '0',\n    'hive.metastore.execute.setugi': 'false',\n    'hive.metastore.failure.retries': '1',\n    'hive.metastore.force.reload.conf': 'false',\n    'hive.metastore.fs.handler.class': 'org.apache.hadoop.hive.metastore.HiveMetaStoreFsImpl',\n    'hive.metastore.kerberos.principal': 'hive-metastore/_HOST@EXAMPLE.COM',\n    'hive.metastore.rawstore.impl': 'org.apache.hadoop.hive.metastore.ObjectStore',\n    'hive.metastore.sasl.enabled': 'false',\n    'hive.metastore.server.max.threads': '100000',\n    'hive.metastore.server.min.threads': '200',\n    'hive.metastore.server.tcp.keepalive': 'true',\n    'hive.metastore.thrift.framed.transport.enabled': 'false',\n    'hive.metastore.warehouse.dir': '/shib/warehouse',\n    'hive.multi.insert.move.tasks.share.dependencies': 'false',\n    'hive.multigroupby.singlereducer': 'true',\n    'hive.optimize.bucketmapjoin': 'false',\n    'hive.optimize.bucketmapjoin.sortedmerge': 'false',\n    'hive.optimize.cp': 'true',\n    'hive.optimize.groupby': 'true',\n    'hive.optimize.index.autoupdate': 'false',\n    'hive.optimize.index.filter': 'false',\n    'hive.optimize.index.filter.compact.maxsize': '-1',\n    'hive.optimize.index.filter.compact.minsize': '5368709120',\n    'hive.optimize.index.groupby': 'false',\n    'hive.optimize.listbucketing': 'false',\n    'hive.optimize.metadataonly': 'true',\n    'hive.optimize.ppd': 'true',\n    'hive.optimize.ppd.storage': 'true',\n    'hive.optimize.reducededuplication': 'true',\n    'hive.optimize.skewjoin': 'false',\n    'hive.optimize.skewjoin.compiletime': 'false',\n    'hive.optimize.union.remove': 'false',\n    'hive.outerjoin.supports.filters': 'true',\n    'hive.ppd.recognizetransivity': 'true',\n    'hive.ppd.remove.duplicatefilters': 'true',\n    'hive.query.id': 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',\n    'hive.query.result.fileformat': 'TextFile',\n    'hive.query.string': '--- 3578d8d4 SELECT count(*) AS cnt FROM access_log WHERE (service=\\'blog\\' OR service=\\'blogimg\\') AND yyyymmdd=\\'20130410\\'',\n    'hive.querylog.enable.plan.progress': 'true',\n    'hive.querylog.location': '/tmp/hive',\n    'hive.querylog.plan.progress.interval': '60000',\n    'hive.rework.mapredwork': 'false',\n    'hive.sample.seednumber': '0',\n    'hive.script.auto.progress': 'false',\n    'hive.script.operator.id.env.var': 'HIVE_SCRIPT_OPERATOR_ID',\n    'hive.script.operator.truncate.env': 'false',\n    'hive.script.recordreader': 'org.apache.hadoop.hive.ql.exec.TextRecordReader',\n    'hive.script.recordwriter': 'org.apache.hadoop.hive.ql.exec.TextRecordWriter',\n    'hive.script.serde': 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe',\n    'hive.security.authenticator.manager': 'org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator',\n    'hive.security.authorization.enabled': 'false',\n    'hive.security.authorization.manager': 'org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider',\n    'hive.security.metastore.authenticator.manager': 'org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator',\n    'hive.security.metastore.authorization.manager': 'org.apache.hadoop.hive.ql.security.authorization.DefaultHiveMetastoreAuthorizationProvider',\n    'hive.server.read.socket.timeout': '10',\n    'hive.server.tcp.keepalive': 'true',\n    'hive.server2.authentication': 'NONE',\n    'hive.server2.enable.impersonation': 'false',\n    'hive.server2.thrift.max.worker.threads': '100',\n    'hive.server2.thrift.min.worker.threads': '5',\n    'hive.server2.thrift.port': '10000',\n    'hive.session.id': 'hive_201304111606',\n    'hive.session.silent': 'false',\n    'hive.skewjoin.key': '100000',\n    'hive.skewjoin.mapjoin.map.tasks': '10000',\n    'hive.skewjoin.mapjoin.min.split': '33554432',\n    'hive.start.cleanup.scratchdir': 'false',\n    'hive.stats.atomic': 'false',\n    'hive.stats.autogather': 'false',\n    'hive.stats.collect.rawdatasize': 'true',\n    'hive.stats.collect.tablekeys': 'false',\n    'hive.stats.dbclass': 'jdbc:derby',\n    'hive.stats.dbconnectionstring': 'jdbc:derby:;databaseName=TempStatsStore;create=true',\n    'hive.stats.jdbc.timeout': '30',\n    'hive.stats.jdbcdriver': 'org.apache.derby.jdbc.EmbeddedDriver',\n    'hive.stats.ndv.error': '20.0',\n    'hive.stats.reliable': 'false',\n    'hive.stats.retries.max': '0',\n    'hive.stats.retries.wait': '3000',\n    'hive.support.concurrency': 'false',\n    'hive.task.progress': 'false',\n    'hive.test.mode': 'false',\n    'hive.test.mode.prefix': 'test_',\n    'hive.test.mode.samplefreq': '32',\n    'hive.transform.escape.input': 'false',\n    'hive.udtf.auto.progress': 'false',\n    'hive.unlock.numretries': '10',\n    'hive.variable.substitute': 'true',\n    'hive.variable.substitute.depth': '40',\n    'hive.warehouse.subdir.inherit.perms': 'true',\n    'hive.zookeeper.clean.extra.nodes': 'false',\n    'hive.zookeeper.client.port': '2181',\n    'hive.zookeeper.namespace': 'hive_zookeeper_namespace',\n    'hive.zookeeper.session.timeout': '600000',\n    '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',\n    'io.file.buffer.size': '131072',\n    'io.map.index.interval': '128',\n    'io.map.index.skip': '0',\n    'io.mapfile.bloom.error.rate': '0.005',\n    'io.mapfile.bloom.size': '1048576',\n    'io.native.lib.available': 'true',\n    'io.seqfile.compress.blocksize': '1000000',\n    'io.seqfile.lazydecompress': 'true',\n    'io.seqfile.local.dir': '/path/to/seqfile/local/dir/list',\n    'io.seqfile.sorter.recordlimit': '1000000',\n    'io.serializations': 'org.apache.hadoop.io.serializer.WritableSerialization,org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization,org.apache.hadoop.io.serializer.avro.AvroReflectSerialization',\n    'io.skip.checksum.errors': 'false',\n    'io.sort.factor': '10',\n    'io.sort.mb': '100',\n    'io.sort.record.percent': '0.05',\n    'io.sort.spill.percent': '0.80',\n    'ipc.client.connect.max.retries': '10',\n    'ipc.client.connect.max.retries.on.timeouts': '45',\n    'ipc.client.connection.maxidletime': '10000',\n    'ipc.client.idlethreshold': '4000',\n    'ipc.client.kill.max': '10',\n    'ipc.client.tcpnodelay': 'false',\n    'ipc.server.listen.queue.size': '128',\n    'ipc.server.tcpnodelay': 'false',\n    'javax.jdo.PersistenceManagerFactoryClass': 'org.datanucleus.jdo.JDOPersistenceManagerFactory',\n    'javax.jdo.option.ConnectionDriverName': 'com.mysql.jdbc.Driver',\n    'javax.jdo.option.ConnectionPassword': 'HIVE',\n    'javax.jdo.option.ConnectionURL': 'jdbc:mysql://database.metastore.hadoo.local/metastore',\n    'javax.jdo.option.ConnectionUserName': 'hive',\n    'javax.jdo.option.DetachAllOnCommit': 'true',\n    'javax.jdo.option.Multithreaded': 'true',\n    'javax.jdo.option.NonTransactionalRead': 'true',\n    'job.end.retry.attempts': '0',\n    'job.end.retry.interval': '30000',\n    'jobclient.completion.poll.interval': '5000',\n    'jobclient.output.filter': 'FAILED',\n    'jobclient.progress.monitor.poll.interval': '1000',\n    'keep.failed.task.files': 'false',\n    'kfs.blocksize': '67108864',\n    'kfs.bytes-per-checksum': '512',\n    'kfs.client-write-packet-size': '65536',\n    'kfs.replication': '3',\n    'kfs.stream-buffer-size': '4096',\n    'local.cache.size': '10737418240',\n    'map.sort.class': 'org.apache.hadoop.util.QuickSort',\n    'mapred.acls.enabled': 'false',\n    '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',\n    'mapred.cache.files.filesizes': '69754,57899,3909',\n    'mapred.cache.files.timestamps': '1365663998711,1365663998741,1365663998755',\n    'mapred.child.java.opts': '-Xmx2048m',\n    'mapred.child.tmp': './tmp',\n    'mapred.cluster.map.memory.mb': '-1',\n    'mapred.cluster.max.map.memory.mb': '-1',\n    'mapred.cluster.max.reduce.memory.mb': '-1',\n    'mapred.cluster.reduce.memory.mb': '-1',\n    'mapred.committer.job.setup.cleanup.needed': 'false',\n    'mapred.compress.map.output': 'false',\n    'mapred.create.symlink': 'yes',\n    'mapred.disk.healthChecker.interval': '60000',\n    'mapred.healthChecker.interval': '60000',\n    'mapred.healthChecker.script.timeout': '600000',\n    'mapred.heartbeats.in.second': '100',\n    'mapred.inmem.merge.threshold': '1000',\n    'mapred.input.dir': 'hdfs://namenodehacluster/shib/warehouse/access_log/service=blog/yyyymmdd=20130410,hdfs://namenodehaclustername/shib/warehouse/access_log/service=blogimg/yyyymmdd=20130410',\n    'mapred.input.dir.recursive': 'false',\n    'mapred.input.format.class': 'org.apache.hadoop.hive.ql.io.CombineHiveInputFormat',\n    'mapred.jar': '/mapred/staging/hive/.staging/job_201304011701_1912/job.jar',\n    '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',\n    'mapred.job.map.memory.mb': '-1',\n    'mapred.job.name': 'shib-3578d8d4f5a1812de7a7714f5b108776',\n    'mapred.job.queue.name': 'default',\n    'mapred.job.reduce.input.buffer.percent': '0.0',\n    'mapred.job.reduce.memory.mb': '-1',\n    'mapred.job.restart.recover': 'true',\n    'mapred.job.reuse.jvm.num.tasks': '1',\n    'mapred.job.shuffle.input.buffer.percent': '0.70',\n    'mapred.job.shuffle.merge.percent': '0.66',\n    'mapred.job.tracker': 'master.hadoop.local:8021',\n    'mapred.job.tracker.handler.count': '150',\n    'mapred.job.tracker.http.address': 'master.hadoop.local:50030',\n    'mapred.job.tracker.jobhistory.lru.cache.size': '5',\n    'mapred.job.tracker.persist.jobstatus.active': 'false',\n    'mapred.job.tracker.persist.jobstatus.dir': '/jobtracker/jobsInfo',\n    'mapred.job.tracker.persist.jobstatus.hours': '0',\n    'mapred.job.tracker.retiredjobs.cache.size': '1000',\n    'mapred.jobtracker.completeuserjobs.maximum': '100',\n    'mapred.jobtracker.instrumentation': 'org.apache.hadoop.mapred.JobTrackerMetricsInst',\n    'mapred.jobtracker.job.history.block.size': '3145728',\n    'mapred.jobtracker.maxtasks.per.job': '-1',\n    'mapred.jobtracker.restart.recover': 'false',\n    'mapred.jobtracker.taskScheduler': 'org.apache.hadoop.mapred.JobQueueTaskScheduler',\n    'mapred.line.input.format.linespermap': '1',\n    'mapred.local.dir': '/mapred/local/dir/list',\n    'mapred.local.dir.minspacekill': '0',\n    'mapred.local.dir.minspacestart': '0',\n    'mapred.map.child.log.level': 'INFO',\n    'mapred.map.max.attempts': '4',\n    'mapred.map.output.compression.codec': 'org.apache.hadoop.io.compress.DefaultCodec',\n    'mapred.map.tasks': '2867',\n    'mapred.map.tasks.speculative.execution': 'false',\n    'mapred.mapoutput.key.class': 'org.apache.hadoop.hive.ql.io.HiveKey',\n    'mapred.mapoutput.value.class': 'org.apache.hadoop.io.BytesWritable',\n    'mapred.mapper.class': 'org.apache.hadoop.hive.ql.exec.ExecMapper',\n    'mapred.max.split.size': '256000000',\n    'mapred.max.tracker.blacklists': '4',\n    'mapred.max.tracker.failures': '4',\n    'mapred.merge.recordsBeforeProgress': '10000',\n    'mapred.min.split.size': '1',\n    'mapred.min.split.size.per.node': '1',\n    'mapred.min.split.size.per.rack': '1',\n    'mapred.output.committer.class': 'org.apache.hadoop.hive.shims.HadoopShimsSecure$NullOutputCommitter',\n    'mapred.output.compress': 'true',\n    'mapred.output.compression.codec': 'org.apache.hadoop.io.compress.GzipCodec',\n    'mapred.output.compression.type': 'BLOCK',\n    'mapred.output.format.class': 'org.apache.hadoop.hive.ql.io.HiveOutputFormatImpl',\n    'mapred.output.key.class': 'org.apache.hadoop.io.Text',\n    'mapred.output.value.class': 'org.apache.hadoop.io.Text',\n    'mapred.partitioner.class': 'org.apache.hadoop.hive.ql.io.DefaultHivePartitioner',\n    'mapred.queue.default.acl-administer-jobs': '*',\n    'mapred.queue.default.state': 'RUNNING',\n    'mapred.queue.names': 'default',\n    'mapred.reduce.child.log.level': 'INFO',\n    'mapred.reduce.max.attempts': '4',\n    'mapred.reduce.parallel.copies': '5',\n    'mapred.reduce.slowstart.completed.maps': '0.05',\n    'mapred.reduce.tasks': '1',\n    'mapred.reduce.tasks.speculative.execution': 'true',\n    'mapred.reducer.class': 'org.apache.hadoop.hive.ql.exec.ExecReducer',\n    'mapred.skip.attempts.to.start.skipping': '2',\n    'mapred.skip.map.auto.incr.proc.count': 'true',\n    'mapred.skip.map.max.skip.records': '0',\n    'mapred.skip.reduce.auto.incr.proc.count': 'true',\n    'mapred.skip.reduce.max.skip.groups': '0',\n    'mapred.submit.replication': '10',\n    'mapred.system.dir': '/mapred/system',\n    'mapred.task.cache.levels': '2',\n    'mapred.task.profile': 'false',\n    'mapred.task.profile.maps': '0-2',\n    'mapred.task.profile.reduces': '0-2',\n    'mapred.task.timeout': '600000',\n    'mapred.task.tracker.http.address': '0.0.0.0:50060',\n    'mapred.task.tracker.report.address': '127.0.0.1:0',\n    'mapred.task.tracker.task-controller': 'org.apache.hadoop.mapred.DefaultTaskController',\n    'mapred.tasktracker.dns.interface': 'default',\n    'mapred.tasktracker.dns.nameserver': 'default',\n    'mapred.tasktracker.expiry.interval': '600000',\n    'mapred.tasktracker.indexcache.mb': '10',\n    'mapred.tasktracker.instrumentation': 'org.apache.hadoop.mapred.TaskTrackerMetricsInst',\n    'mapred.tasktracker.map.tasks.maximum': '6',\n    'mapred.tasktracker.reduce.tasks.maximum': '2',\n    'mapred.tasktracker.taskmemorymanager.monitoring-interval': '5000',\n    'mapred.tasktracker.tasks.sleeptime-before-sigkill': '5000',\n    'mapred.temp.dir': '${hadoop.tmp.dir}/mapred/temp',\n    'mapred.user.jobconf.limit': '5242880',\n    'mapred.userlog.limit.kb': '0',\n    'mapred.userlog.retain.hours': '96',\n    'mapred.working.dir': 'hdfs://namenodeclustername/user/hive',\n    'mapreduce.framework.name': 'classic',\n    'mapreduce.ifile.readahead': 'true',\n    'mapreduce.ifile.readahead.bytes': '4194304',\n    'mapreduce.job.acl-modify-job': '',\n    'mapreduce.job.acl-view-job': '',\n    'mapreduce.job.cache.files.visibilities': 'true,false,false',\n    'mapreduce.job.committer.task.cleanup.needed': 'false',\n    'mapreduce.job.complete.cancel.delegation.tokens': 'true',\n    'mapreduce.job.dir': 'hdfs://namenodehaclustername/mapred/staging/hive/.staging/job_201304011701_1912',\n    'mapreduce.job.map.output.collector.class': 'org.apache.hadoop.mapred.MapTask$MapOutputBuffer',\n    'mapreduce.job.maps.speculative.execution': 'false',\n    'mapreduce.job.name': 'shib-3578d8d4f5a1812de7a7714f5b108776',\n    'mapreduce.job.reduce.shuffle.consumer.plugin.class': 'org.apache.hadoop.mapred.ReduceTask$ReduceCopier',\n    'mapreduce.job.reduces.speculative.execution': 'false',\n    'mapreduce.job.submithost': '4c3bd1118.livedoor',\n    'mapreduce.job.submithostaddress': '10.130.74.79',\n    'mapreduce.jobtracker.split.metainfo.maxsize': '10000000',\n    'mapreduce.jobtracker.staging.root.dir': '/mapred/staging',\n    'mapreduce.map.log.level': 'WARN',\n    'mapreduce.map.memory.mb': '1024',\n    'mapreduce.reduce.input.limit': '-1',\n    'mapreduce.reduce.log.level': 'WARN',\n    'mapreduce.reduce.memory.mb': '2048',\n    'mapreduce.reduce.shuffle.connect.timeout': '180000',\n    'mapreduce.reduce.shuffle.maxfetchfailures': '10',\n    'mapreduce.reduce.shuffle.read.timeout': '180000',\n    'mapreduce.shuffle.ssl.address': '0.0.0.0',\n    'mapreduce.shuffle.ssl.enabled': '${hadoop.ssl.enabled}',\n    'mapreduce.shuffle.ssl.port': '50443',\n    'mapreduce.tasktracker.cache.local.numberdirectories': '10000',\n    'mapreduce.tasktracker.outofband.heartbeat': 'false',\n    'net.topology.node.switch.mapping.impl': 'org.apache.hadoop.net.ScriptBasedMapping',\n    'net.topology.script.number.args': '100',\n    's3.blocksize': '67108864',\n    's3.bytes-per-checksum': '512',\n    's3.client-write-packet-size': '65536',\n    's3.replication': '3',\n    's3.stream-buffer-size': '4096',\n    's3native.blocksize': '67108864',\n    's3native.bytes-per-checksum': '512',\n    's3native.client-write-packet-size': '65536',\n    's3native.replication': '3',\n    's3native.stream-buffer-size': '4096',\n    'tasktracker.http.threads': '120',\n    'tfile.fs.input.buffer.size': '262144',\n    'tfile.fs.output.buffer.size': '262144',\n    'tfile.io.chunk.size': '1048576',\n    tmpjars: 'file:///home/user/woothee.jar,file:///usr/lib/hive/lib/hive-builtins-0.10.0-cdh4.2.0.jar',\n    'user.name': 'hive'\n  },\n */"
  },
  {
    "path": "lib/shib/engines/huahin_mrv1/rest.js",
    "content": "var http = require('http');\n\nvar Client = exports.Client = function(host, port){\n  this.host = host;\n  this.port = port;\n};\n\nClient.prototype.listAll = function(callback){\n  return this.list('all', callback);\n};\n\nClient.prototype.list = function(type, callback){\n  var path = '/job/list';\n  switch(type) {\n  case 'failed':    path = '/job/list/failed'; break;\n  case 'killed':    path = '/job/list/killed'; break;\n  case 'prep':      path = '/job/list/prep'; break;\n  case 'running':   path = '/job/list/running'; break;\n  case 'succeeded': path = '/job/list/succeeded'; break;\n  }\n  this.request('GET', path, callback);\n};\n\nClient.prototype.status = function(jobid, callback){\n  this.request('GET', '/job/status/' + jobid, callback);\n};\n\nClient.prototype.detail = function(jobid, callback){\n  this.request('GET', '/job/detail/' + jobid, callback);\n};\n\nClient.prototype.kill = function(jobid, callback){\n  this.request('DELETE', '/job/kill/id/' + jobid, callback);\n};\n\nClient.prototype.killByName = function(jobname, callback){\n  this.request('DELETE', '/job/kill/name/' + jobname, callback);\n};\n\nClient.prototype.request = function(method, path, callback){\n  var options = {\n    host: this.host,\n    port: this.port,\n    path: path,\n    method: method\n  };\n  var cb = function(res){\n    if (res.statusCode < 200 || res.statusCode >= 300) {\n      callback({message: \"Huahin Manager returns response code \" + res.statusCode});\n      return; \n    }\n    // status: 2xx\n\n    if (! res.headers['content-type'].match(/^application\\/json/)) {\n      callback(null);\n      return;\n    }\n\n    // content-type: application/json\n    var jsondata = '';\n    res.on('data', function(chunk){\n      jsondata += chunk;\n      var data = null;\n      try {\n        data = JSON.parse(jsondata);\n      }\n      catch (e) { /* jsondata is not complete */\n        data = null;\n      }\n      if (data) {\n        callback(null,data);\n        jsondata = null;\n      }\n    });\n  };\n  var errcb = function(e){ callback(e, null); };\n  http.request(options, cb).on('error', errcb).end();\n};\n"
  },
  {
    "path": "lib/shib/engines/huahin_yarn/index.js",
    "content": "var RESTClient = require('./rest').Client;\n\nvar Monitor = exports.Monitor = function(conf, logger) {\n  if (conf.name !== 'huahin_yarn')\n    throw \"monitor name mismatch for huahin_yarn:\" + conf.name;\n\n  this.logger = logger;\n  this._client = new RESTClient(conf.host, conf.port);\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) {\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for huahin_yarn.Monitor):\" + operation;\n};\n\nfunction convertStatus(status, info) {  // 'status' is one of members of \"app\", and 'info' is value of 'info'\n/*\n{\"apps\": {\"app\": [\n  {\n    \"diagnostics\": \"\",\n    \"elapsedTime\": \"23sec\",\n    \"finalStatus\": \"UNDEFINED\",\n    \"finishTime\": \"\",\n    \"id\": \"application_1362452667651_1406\",\n    \"name\": \"'test job 1'\",\n    \"queue\": \"default\",\n    \"startTime\": \"Mon Mar 11 15:37:48 JST 2013\",\n    \"state\": \"RUNNING\",\n    \"trackingUI\": \"ApplicationMaster\",\n    \"trackingURL\": \"4c3bd1118.livedoor:8088/proxy/application_1362452667651_1406/\",\n    \"user\": \"hive\"\n  },\n  {\n    \"diagnostics\": \"\",\n    \"elapsedTime\": \"40sec\",\n    \"finalStatus\": \"SUCCEEDED\",\n    \"finishTime\": \"Sun Mar 10 05:40:43 JST 2013\",\n    \"id\": \"application_1362452667651_1075\",\n    \"name\": \"--- 57991d00\\nSELECT count(*) as cnt, y...100(Stage-2)\",\n    \"queue\": \"default\",\n    \"startTime\": \"Sun Mar 10 05:40:02 JST 2013\",\n    \"state\": \"FINISHED\",\n    \"trackingUI\": \"History\",\n    \"trackingURL\": \"4c3bd1118.livedoor:8088/proxy/application_1362452667651_1075/jobhistory/job/job_1362452667651_1075\",\n    \"user\": \"hive\"\n  },\n]}}\n */\n  /*\n   {\"info\": {\n     \"appId\": \"application_1363145337412_0001\",\n     \"elapsedTime\": 61245,\n     \"name\": \"select count(*) as cnt from...service='blog'(Stage-1)\",\n     \"startedOn\": 1365758130628,\n     \"user\": \"hive\"\n   }}\n */\n  /*\n  var returnedValus = {\n    jobid: 'job_201304011701_1912',\n    name: 'shib-3578d8d4f5a1812de7a7714f5b108776',\n    priority: 'NORMAL',\n    state: 'RUNNING',\n    trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',\n    startTime: 'Thu Apr 11 2013 16:06:40 (JST)',\n    mapComplete: 89,\n    reduceComplete: 29,\n    hiveQueryId: 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',\n    hiveQueryString: 'SELECT ...'\n  };\n   */\n  if (status === undefined) {\n    return null;\n  }\n  var retval = {};\n\n  retval['jobid'] = status['id'];\n  retval['name'] = status['name'];\n  retval['priority'] = 'unknown';\n  retval['state'] = (status['state'] === 'FINISHED' ? status['finalStatus'] : status['state']);\n  retval['trackingURL'] = status['trackingURL'];\n\n  retval['startTime'] = (function(sourceDate){\n    // convert for `new Date(string)` acceptable format\n    // 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'\n\n    // [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year\n    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);\n    if (! match) { return null; }\n    // -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)\n    return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');\n  })(status['startTime']);\n\n  retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);\n  retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);\n\n  retval['hiveQueryId'] = (status['configuration'] || {})['hive.query.id'];\n  retval['hiveQueryString'] = (status['configuration'] || {})['hive.query.string'];\n\n  return retval;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  var client = this._client;\n  client.list(function(err, result){\n    if (err || !result || !result['apps'] || !result['apps']['app']) { callback(err, null); return; }\n    \n    var appstatus = null;\n    result['apps']['app'].forEach(function(app){\n      if (app.name === jobname)\n        appstatus = app;\n    });\n    if (!appstatus) { callback(null, null); return; }\n\n    client.mapreduceinfo(appstatus['id'], function(err, info){\n      if (err || !info['info']) { callback(err, null); return; }\n      callback(null, convertStatus(appstatus, info['info']));\n    });\n  });\n};\n\nMonitor.prototype.kill = function(jobname, callback){\n  var client = this._client;\n  this.status(jobname, function(err, app){\n    if (!app) { callback({message:'kill target application not found:' + jobname}); return; }\n    //TODO: check attribute name\n    client.kill(app.id, callback);\n  });\n};\n"
  },
  {
    "path": "lib/shib/engines/huahin_yarn/rest.js",
    "content": "var http = require('http');\n\nvar Client = exports.Client = function(host, port){\n  this._host = host;\n  this._port = port;\n};\n\n// curl -X GET \"http://<HOSTNAME>:9010/application/list\"\nClient.prototype.list = function(callback){\n  this.request('GET', '/application/list', callback);\n};\n\n// curl -X GET \"http://<HOSTNAME>:9010/application/cluster\"\nClient.prototype.cluster = function(callback){\n  this.request('GET', '/application/cluster', callback);\n};\n\n// curl -X DELETE \"http://<HOSTNAME>:9010/application/kill/{appid}\"\nClient.prototype.kill = function(appid, callback){\n  this.request('DELETE', '/application/kill/' + appid, callback);\n};\n\n// curl -X GET \"http://<HOSTNAME>:9010/api/proxy/{appid}/ws/v1/mapreduce/info\"\nClient.prototype.mapreduceinfo = function(appid, callback){\n  this.request('GET', '/api/proxy/' + appid + '/ws/v1/mapreduce/info', callback);\n};\n\nClient.prototype.request = function(method, path, callback){\n  var options = {\n    host: this._host,\n    port: this._port,\n    path: path,\n    method: method\n  };\n  var cb = function(res){\n    if (res.statusCode < 200 || res.statusCode >= 300) {\n      callback({message: \"Huahin Manager returns response code \" + res.statusCode});\n      return; \n    } \n    // status: 2xx\n    \n    if (! res.headers['content-type'].match(/^application\\/json/)) {\n      callback(null);\n      return;\n    } \n    \n    // content-type: application/json\n    var jsondata = '';\n    res.on('data', function(chunk){\n      jsondata += chunk;\n      var data = null;\n      try {\n        data = JSON.parse(jsondata);\n      } \n      catch (e) { /* jsondata is not complete */\n        data = null;\n      } \n      if (data) {\n        callback(null,data);\n        jsondata = null;\n      } \n    }); \n  };\n  var errcb = function(e){ callback(e, null); };\n  http.request(options, cb).on('error', errcb).end();\n};\n"
  },
  {
    "path": "lib/shib/engines/jobtracker/client.js",
    "content": "var http = require('http')\n  , child_process = require('child_process');\n\nvar cheerio = require('cheerio');\n\nvar MRv1Client = exports.MRv1Client = function(host, port, mapred){\n  this.host = host; // jobtracker.hostname.local\n  this.port = port; // 50030\n  this.mapred = mapred;\n};\n\nMRv1Client.prototype.listAll = function(callback){\n  this.request('/jobtracker.jsp', function(err, html){\n    if (err) { callback(err); return; }\n    var $ = cheerio.load(html);\n    var jobs = [];\n    ['h2#running_jobs', 'h2#completed_jobs', 'h2#failed_jobs'].forEach(function(marker){\n      if ($(marker).next().is('table') && $(marker).next().find('tr td').text() !== 'none') {\n        $(marker).next().find('tbody tr').each(function(i, e){\n          var row = $(e).find('td');\n          jobs.push({ jobid: row.eq(0).text(), name: row.eq(3).text(), priority: row.eq(1).text() });\n        });\n      }\n    });\n    callback(null, jobs);\n  });\n};\n\nMRv1Client.prototype.detail = function(jobid, opts, callback){\n  var self = this;\n  var path = '/jobdetails.jsp?jobid=' + jobid;\n  this.request(path, function(err, html){\n    if (err) { callback(err); return; }\n    var job = {\n      jobid: jobid,\n      name: '',\n      priority: opts.priority,\n      state: '',\n      trackingURL: 'http://' + self.host + ':' + self.port + path,\n      startTime: '',\n      mapComplete: 0,\n      reduceComplete: 0\n    };\n    var $ = cheerio.load(html);\n\n    $('body').html().split('\\n').forEach(function(line){\n      var match = /^<b>(.+):<\\/b> (.*)<br>$/.exec(line);\n      if (match) {\n        if (match[1] === 'Job Name') {\n          job['name'] = match[2];\n        } else if (match[1] === 'Status') {\n          job['state'] = match[2];\n        } else if (match[1] === 'Started at') {\n          job['startTime'] = match[2];\n        }\n      }\n    });\n\n    var progress = $('table').first();\n    job['mapComplete'] = parseInt(progress.children().eq(1).find('td').first().text());\n    job['reduceComplete'] = parseInt(progress.children().eq(2).find('td').first().text());\n\n    callback(null, job);\n  });\n};\n\nMRv1Client.prototype.kill = function(jobid, callback){\n  var command = this.mapred + \" job -kill \" + jobid;\n  child_process.exec(command, function(err, stdout, stderr){\n    callback(err);\n  });\n};\n\nMRv1Client.prototype.request = function(path, callback){\n  var options = {\n    host: this.host,\n    port: this.port,\n    path: path,\n    method: 'GET'\n  };\n  var cb = function(res){\n    if (res.statusCode < 200 || res.statusCode >= 300) {\n      callback({message: \"JobTracker returns response code \" + res.statusCode});\n      return; \n    }\n    res.setEncoding('utf8');\n    var html = '';\n    res.on('data', function(chunk){\n      html += chunk;\n    });\n    res.on('end', function(){\n      callback(null, html);\n    });\n  };\n  var errcb = function(e){ callback(e, null); };\n  http.request(options, cb).on('error', errcb).end();\n};\n"
  },
  {
    "path": "lib/shib/engines/jobtracker/index.js",
    "content": "var MRv1Client = require('./client').MRv1Client;\n\nvar Monitor = exports.Monitor = function(conf, logger) {\n  if (conf.name !== 'jobtracker')\n    throw \"monitor name mismatch for jobtracker:\" + conf.name;\n\n  if (!conf.host || !conf.port) {\n    throw \"JobTracker WebUI host/port not specified\";\n  }\n  var mapred = conf.mapred;\n  if (! conf.mapred) {\n    mapred = 'mapred';\n  }\n\n  this.logger = logger;\n  this._client = new MRv1Client(conf.host, conf.port, mapred);\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) {\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for jobtracker.Monitor):\" + operation;\n};\n\nfunction convertStatus(status) {\n  if (status === undefined) {\n    return null;\n  }\n  var retval = {};\n\n  retval['jobid'] = status['jobid'];\n  retval['name'] = status['name'];\n  retval['priority'] = status['priority'];\n  retval['state'] = status['state'];\n  retval['trackingURL'] = status['trackingURL'];\n\n  retval['startTime'] = (function(sourceDate){\n    // convert for `new Date(string)` acceptable format\n    // 'Thu Apr 11 16:06:40 JST 2013' -> 'Thu Apr 11 2013 16:06:40 (JST)'\n\n    // [1]Weekday, [2]Month, [3]Day, [4]Time, [5]TimeZone, [6]Year\n    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);\n    if (! match) { return null; }\n    // -> [1]Weekday, [2]Month, [3]Day, [6]Year, [4]Time, ([5]TimeZone)\n    return [match[1], match[2], match[3], match[6], match[4], '(' + match[5] + ')'].join(' ');\n  })(status['startTime']);\n\n  retval['mapComplete'] = (status['mapComplete'] ? parseInt(status['mapComplete']) : null);\n  retval['reduceComplete'] = (status['reduceComplete'] ? parseInt(status['reduceComplete']) : null);\n\n  return retval;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  var client = this._client;\n  client.listAll(function(err, result){\n    if (err || !result) { callback(err, null); return; }\n\n    var jobid = null;\n    var opts = {\n    };\n    result.forEach(function(job){\n      if (job.name === jobname) {\n        jobid = job.jobid;\n        opts['priority'] = job.priority;\n      }\n    });\n    if (!jobid) { callback(null, null); return; }\n\n    client.detail(jobid, opts, function(err, data){\n      if (err) { callback(err); return; }\n      callback(null, convertStatus(data));\n    });\n  });\n};\n\nMonitor.prototype.kill = function(jobid, callback){\n  this._client.kill(jobid, callback);\n};\n"
  },
  {
    "path": "lib/shib/engines/presto/index.js",
    "content": "var Client = require('presto-client').Client\n  , JSONbig = require('json-bigint');\n\n// check interval for real queries, not system queries\nvar BLOCK_CHECK_INTERVAL = 1000; // 1sec\n\nvar jobname_queryid_map = {};\n\nvar Executer = exports.Executer = function(conf, logger){\n  if (conf.name !== 'presto')\n    throw \"executer name mismatch for presto:\" + conf.name;\n  if (!conf.host)\n    throw \"host MUST be specified for presto executer\";\n  if (!conf.port)\n    throw \"port MUST be specified for presto executer\";\n  if (!conf.catalog)\n    throw \"catalog MUST be specified for presto executer\";\n\n  this.logger = logger;\n  this._client = new Client({\n    host: conf.host,\n    port: conf.port,\n    user: conf.user,\n    catalog: conf.catalog,\n    jsonParser: JSONbig\n  });\n};\n\nExecuter.prototype.end = function(){\n  // Nothing to do for HTTP API :-)\n};\n\nExecuter.prototype.supports = function(operation){\n  switch (operation) { // \"executer\" methods\n  case 'jobname':\n  case 'setup':\n  case 'databases':\n  case 'tables':\n  case 'partitions':\n  case 'describe':\n  case 'execute':\n    return true;\n  }\n  throw \"unknown operation name (for presto.Executer):\" + operation;\n};\n\nExecuter.prototype.jobname = function(queryid) {\n  return 'shib-presto-' + queryid;\n};\n\nExecuter.prototype.setup = function(setups, callback){\n  // presto engine currently does not support 'setup', because of lack of UDFs\n  callback(null);\n};\n\nExecuter.prototype.options = function(query, schema, func){\n  var options = {\n    query:  query,\n    schema: schema,\n    state:   function(error, query_id, stats){ /*console.log({message:\"status changed\", id:query_id, stats:stats});*/ },\n    columns: function(error, data){ /*console.log({resultColumns: data});*/ },\n    data:    function(error, data, columns, stats){ func(error, data) },\n    success: function(error, stats){},\n    error:   function(error){console.log(error);}\n  };\n  return options\n};\n\nExecuter.prototype.databases = function(callback){\n  this._client.execute(this.options('show schemas', 'dummy', function(err, data){\n    if (err) { callback(err); return; }\n    // [ [ 'default' ], [ 'information_schema' ], [ 'sys' ] ]\n    // database names may be always string...\n    var results = [];\n    data.forEach(function(row){\n      var dbname = row[0];\n      if (dbname !== 'information_schema' && dbname !== 'sys' )\n        results.push(dbname);\n    });\n    callback(null, results);\n  }));\n};\n\nExecuter.prototype.tables = function(dbname, callback){\n  this._client.execute(this.options('show tables', dbname, function(err, data){\n    if (err) { callback(err); return; }\n    // [ [ 'table1' ], [ 'table2' ], ... ]\n    // table names may be always string...\n    var results = data.map(function(row){ return row[0]; });\n    callback(null, results);\n  }));\n};\n\nExecuter.prototype.partitions = function(dbname, tablename, callback){\n  var client = this._client;\n  var show_partitions_query = 'show partitions from ' + tablename;\n  var options_ = this.options;\n  client.execute(options_('show columns from ' + tablename, dbname, function(err, data){\n    if (err) { callback(err); return; }\n    // [ [ 'fieldname', 'typename', boolean_null, boolean_partition_key ], ... ]\n    // partition names may be always string...\n    var partitionKeys = [];\n    data.forEach(function(row){\n      if (row[2])\n        partitionKeys.push(row[0]);\n    });\n    client.execute(options_(show_partitions_query, dbname, function(err, data){\n      if (err) { callback(err); return; }\n      // data: [ [ 'partkey1_value', 'partkey2_value' ], ... ]\n      // expected: ['f1=va1/f2=vb1', 'f1=va1/f2=vb2']\n      var results = [];\n      data.forEach(function(row){\n        var part = row.map(function(v,i){ return partitionKeys[i] + '=' + String(v); }).join('/');\n        results.push( part );\n      });\n      callback(null, results);\n    }));\n  }));\n};\n\nExecuter.prototype.describe = function(dbname, tablename, callback){\n  // presto \"show columns from ...\" does not return column comments in hive metastore\n  // schema info members may not include numeric values\n  this._client.execute(this.options('show columns from ' + tablename, dbname, function(err, data){\n    if (err) { callback(err); return; }\n    // data:     [ [ 'fieldname', 'typename', boolean_null, boolean_partition_key ], ... ]\n    // expected: [ [ 'fieldname', 'type', 'comment' ], ... ]\n    var results = data.map(function(row){ return [ row[0], row[1], (row[2] ? 'partition key' : '') ]; });\n    callback(null, results);\n  }));\n};\n\nExecuter.prototype.execute = function(jobname, dbname, query, callback){\n  var client = this._client;\n\n  var fetcher = new Fetcher(client);\n\n  var state_callback = function(e, query_id, stats){\n    jobname_queryid_map[jobname] = query_id;\n  };\n  var columns_callback = function(e, columns){\n    fetcher._cache.schema = columns;\n  };\n  var data_callback = function(e, data){\n    fetcher._hasResults = true;\n    var buf = []\n      , len = data.length;\n    for ( var i = 0 ; i < len ; i++ ) {\n      // data may contain BIGINT values ...\n      // AND join does 'toString()' automatically!\n      buf.push( data[i].join('\\t') );\n    }\n    fetcher._push( buf );\n  };\n  var success_callback = function(e, stats){\n    fetcher._noMoreResults = true;\n    delete jobname_queryid_map[jobname];\n  };\n  var error_callback = function(e){\n    delete jobname_queryid_map[jobname];\n    if (! fetcher._rpcError) // only first error is stored\n      fetcher._rpcError = e;\n  };\n\n  var opts = {\n    query:  query,\n    schema: dbname || 'default',\n    state: state_callback,\n    columns: columns_callback,\n    data:    data_callback,\n    success: success_callback,\n    error:   error_callback\n  };\n  client.execute(opts);\n  callback(null, fetcher);\n};\n\nvar Fetcher = function(client){\n  this._client = client;\n\n  this._hasResults = false;\n  this._noMoreResults = false;\n\n  this._rpcError = null;\n  this._cache = { data: [], schema: null };\n\n  this._push = function(data) {\n    this._cache.data = this._cache.data.concat(data);\n  };\n\n  this._waitComplete = function(callback) {\n    var self = this;\n    var check = function() {\n      if (self._rpcError)\n        callback(self._rpcError);\n      else if (self._hasResults)\n        callback(null);\n      else if (self._noMoreResults)\n        callback(null);\n      else\n        setTimeout(check, BLOCK_CHECK_INTERVAL);\n    };\n    check();\n  };\n\n  this.schema = function(callback){\n    /*\n     * schema(callback): callback(err, schema)\n     *  schema: {fieldSchemas: [{name:'fieldname1'}, {name:'fieldname2'}, {name:'fieldname3'}, ...]}\n     *  //?? schema: [{name:'fieldname1'}, {name:'fieldname2'}, ...]\n     */\n    var self = this;\n    this._waitComplete(function(err){\n      if (err) { callback(err); return; }\n      // self._cache.schema: [ { name: \"username\", type: \"varchar\" }, { name: \"cnt\", type: \"bigint\" } ]\n      callback(null, self._cache.schema);\n    });\n  };\n\n  this.fetch = function(num, callback){\n    if (!num) {\n      this._fetchAll(callback);\n      return;\n    }\n\n    var self = this;\n\n    if (self._cache.data.length < 1 && self._noMoreResults) {\n      // if (rows === null || rows.length < 1 || (rows.length == 1 && rows[0].length < 1)) {\n      // end of fetched rows\n      callback(null, null);\n      return;\n    }\n\n    var buf = [];\n\n    var fill = function() {\n      if (self._rpcError) { callback(self._rpcError); return; }\n      var chunk = self._cache.data.splice(0, num - buf.length);\n\n      if (chunk.length < 1) {\n        if (self._noMoreResults) {\n          var tmpbuf = buf;\n          buf = [];\n          callback(null, tmpbuf); // if tmpbuf is empty, this is end of fetching\n          return;\n        }\n        else {\n          setTimeout(fill, BLOCK_CHECK_INTERVAL);\n          return;\n        }\n      }\n\n      buf = buf.concat(chunk);\n      if (buf.length >= num || self._noMoreResults) {\n        var fullchunk = buf;\n        buf = [];\n        callback(null, fullchunk);\n      }\n      else\n        setTimeout(fill, BLOCK_CHECK_INTERVAL);\n    };\n\n    this._waitComplete(function(err){\n      if (err) { callback(err); return; }\n      fill();\n    });\n  };\n\n  this._fetchAll = function(callback) {\n    var self = this;\n    var check = function() {\n      if (self._rpcError)\n        callback(self._rpcError);\n      else if (self._noMoreResults)\n        callback(null, self._cache.data);\n      else\n        setTimeout(check, BLOCK_CHECK_INTERVAL);\n    };\n    check();\n  };\n};\n\nvar Monitor = exports.Monitor = function(conf){\n  if (conf.name !== 'presto')\n    throw \"executer name mismatch for presto:\" + conf.name;\n  if (!conf.host)\n    throw \"host MUST be specified for presto executer\";\n  if (!conf.port)\n    throw \"port MUST be specified for presto executer\";\n  if (!conf.catalog)\n    throw \"catalog MUST be specified for presto executer\";\n\n  this._client = new Client({\n    host: conf.host,\n    port: conf.port,\n    user: conf.user,\n    catalog: conf.catalog\n  });\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) { // \"monitor\" methods\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for presto.Monitor):\" + operation;\n};\n\nfunction convertStatus(jobname, status) {\n  /*\nvar status = {\n  \"queryId\" : \"20140214_083451_00012_9w6p5\",\n  \"session\" : {\n    \"user\" : \"www\",\n    \"source\" : \"presto-cli\",\n    \"catalog\" : \"hive\",\n    \"schema\" : \"default\",\n    \"remoteUserAddress\" : \"127.0.0.1\",\n    \"userAgent\" : \"StatementClient/0.56\",\n    \"startTime\" : 1392366891516\n  },\n  \"state\" : \"RUNNING\",\n  \"self\" : \"http://10.0.0.1:8080/v1/query/20140214_083451_00012_9w6p5\",\n  \"fieldNames\" : [ \"cnt\" ],\n  \"query\" : \"select count(*) as cnt from tablename where date_time LIKE \\u00272014020%\\u0027\",\n  \"queryStats\" : {\n    \"createTime\" : \"2014-02-14T17:34:51.518+09:00\",\n    \"executionStartTime\" : \"2014-02-14T17:34:52.008+09:00\",\n    \"lastHeartbeat\" : \"2014-02-14T17:35:10.048+09:00\",\n    \"elapsedTime\" : \"18.53s\",\n    \"queuedTime\" : \"2.21ms\",\n    \"analysisTime\" : \"482.62ms\",\n    \"distributedPlanningTime\" : \"760.83us\",\n    \"totalPlanningTime\" : \"485.67ms\",\n    \"totalTasks\" : 9,\n    \"runningTasks\" : 9,\n    \"completedTasks\" : 0,\n    \"totalDrivers\" : 43631,\n    \"queuedDrivers\" : 38,\n    \"runningDrivers\" : 1111,\n    \"completedDrivers\" : 42482,\n    \"totalMemoryReservation\" : \"0B\",\n    \"totalScheduledTime\" : \"3.30h\",\n    \"totalCpuTime\" : \"13.36m\",\n    \"totalUserTime\" : \"12.07m\",\n    \"totalBlockedTime\" : \"12.35s\",\n    \"rawInputDataSize\" : \"14.06GB\",\n    \"rawInputPositions\" : 602557401,\n    \"processedInputDataSize\" : \"9.98GB\",\n    \"processedInputPositions\" : 594796027,\n    \"outputDataSize\" : \"0B\",\n    \"outputPositions\" : 0\n    },\n    \"outputStage\" : {\n      \"stageId\" : \"20140214_083451_00012_9w6p5.0\",\n      \"state\" : \"RUNNING\",\n      \"self\" : \"http://10.0.0.1:8080/v1/stage/20140214_083451_00012_9w6p5.0\",\n      \"plan\" : { ... },\n      \"tupleInfos\" : [ \"bigint\" ],\n      \"stageStats\" : {\n        \"schedulingComplete\" : \"2014-02-14T17:34:52.008+09:00\",\n      ...\n}\nvar returnedValus = {\n  jobid: '20140214_083451_00012_9w6p5',\n  name: 'shib-presto-3578d8d4f5a1812de7a7714f5b108776',\n  priority: 'unknown',\n  state: 'RUNNING',\n  trackingURL: 'http://10.0.0.1:8080/v1/query/20140214_083451_00012_9w6p5?pretty',\n  startTime: 'Thu Apr 11 2013 16:06:40 (JST)',\n  mapComplete: null,\n  reduceComplete: null,\n  complete: 80\n};\n   */\n  if (status === undefined) {\n    return null;\n  }\n  var retval = {};\n\n  retval['jobid'] = status['queryId'];\n  retval['name'] = jobname;\n  retval['priority'] = 'unknown';\n  retval['state'] = status['state'];\n  retval['trackingURL'] = status['self'] + '?pretty';\n\n  retval['startTime'] = status['queryStats']['createTime'];\n  \n  var splits = status.queryStats.totalDrivers;\n  var completedSplits = status.queryStats.completedDrivers;\n  retval['complete'] = parseInt(completedSplits * 1000 / splits) / 10;\n\n  return retval;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  var queryid = jobname_queryid_map[jobname];\n  if (! queryid) {\n    callback({message:\"query already expired (maybe completed)\"}, null);\n    return;\n  }\n  this._client.query(queryid, function(err, data){\n    if (err) { callback(err); return; }\n    callback(null, convertStatus(jobname, data));\n  });\n};\n\nMonitor.prototype.kill = function(query_id, callback){\n  this._client.kill(query_id, callback);\n};\n"
  },
  {
    "path": "lib/shib/engines/yarn/client.js",
    "content": "var http = require('http')\n  , child_process = require('child_process');\n\nvar YARNClient = exports.YARNClient = function(host, port, yarn){\n  this.host = host; // rm.hostname.local\n  this.port = port;\n  this.yarn = yarn;\n};\n\n// https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Applications_API\n//\n// GET \"http://<rm http address:port>/ws/v1/cluster/apps\"\nYARNClient.prototype.applications = function(callback){\n  this.request('GET', '/ws/v1/cluster/apps', callback);\n};\n\n// https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Application_API\n//\n// GET \"http://<rm http address:port>/ws/v1/cluster/apps/{appid}\"\nYARNClient.prototype.application = function(appid, callback){\n  this.request('GET', '/ws/v1/cluster/apps/' + appid, callback);\n};\n\nYARNClient.prototype.request = function(method, path, callback){\n  var options = {\n    host: this.host,\n    port: this.port,\n    path: path,\n    method: method\n  };\n\n  var cb = function(res){\n    if (res.statusCode != 200 ) {\n      callback({message: \"YARN REST API returns response code \" + res.statusCode});\n      return; \n    } \n    // status: 2xx\n    \n    if (! res.headers['content-type'].match(/^application\\/json/)) {\n      callback(null);\n      return;\n    } \n    \n    // content-type: application/json\n    var jsondata = '';\n    res.on('data', function(chunk){\n      jsondata += chunk;\n    });\n    res.on('end', function(){\n      var data = JSON.parse(jsondata);\n      callback(null,data);\n    }); \n  };\n  var errcb = function(e){ callback(e, null); };\n  http.request(options, cb).on('error', errcb).end();\n};\n\nYARNClient.prototype.status = function(jobname, callback){\n  var restClient = this;\n  restClient.applications(function(err, result){\n    if (err || !result || !result['apps'] || !result['apps']['app']) { callback(err, null); return; }\n\n    var appstatus = null;\n    result['apps']['app'].forEach(function(app){\n      if (app.name === jobname)\n        appstatus = app;\n    });\n    if (!appstatus) { callback(null, null); return; }\n\n    restClient.application(appstatus['id'], function(err, info){\n      if (err) { callback(err, null); return; }\n/*\n{\n   \"app\" : {\n      \"finishedTime\" : 1326824991300,\n      \"amContainerLogs\" : \"http://host.domain.com:8042/node/containerlogs/container_1326821518301_0005_01_000001\",\n      \"trackingUI\" : \"History\",\n      \"state\" : \"FINISHED\",\n      \"user\" : \"user1\",\n      \"id\" : \"application_1326821518301_0005\",\n      \"clusterId\" : 1326821518301,\n      \"finalStatus\" : \"SUCCEEDED\",\n      \"amHostHttpAddress\" : \"host.domain.com:8042\",\n      \"progress\" : 100,\n      \"name\" : \"shib-hs2-0ef88408da216fc6f40530c3af38f9ec\",\n      \"applicationType\" : \"Yarn\",\n      \"startedTime\" : 1326824544552,\n      \"elapsedTime\" : 446748,\n      \"diagnostics\" : \"\",\n      \"trackingUrl\" : \"http://host.domain.com:8088/proxy/application_1326821518301_0005/jobhistory/job/job_1326821518301_5_5\",\n      \"queue\" : \"a1\",\n      \"memorySeconds\" : 151730,\n      \"vcoreSeconds\" : 103\n   }\n}\n*/\n      var status = {};\n      status['jobid'] = info['app']['id'];\n      status['name'] = info['app']['name'];\n      status['state'] = info['app']['state'];\n      status['trackingURL'] = info['app']['trackingUrl'];\n      status['startTime'] = new Date(parseInt(info['app']['startedTime'])).toLocaleString();\n      status['mapComplete'] = null;\n      status['reduceComplete'] = null;\n\n      callback(null, status);\n    });\n  });\n};\n\nYARNClient.prototype.kill = function(appid, callback){\n  if(this.yarn) {\n    var command = this.yarn + \" application -kill \" + appid;\n    child_process.exec(command, function(err, stdout, stderr){\n      callback(err);\n    });\n  } else {\n    var options = {\n      host: this.host,\n      port: this.port,\n      path: \"/ws/v1/cluster/apps/\" + appid + \"/state\",\n      method: \"PUT\",\n      headers: {'Content-Type': 'application/json'}\n    };\n\n    var cb = function(res){\n      // status: 2xx\n      var code = String(res.statusCode);\n      if (!code.match(/^2/)) {\n        callback({message: \"YARN REST API returns response code \" + res.statusCode});\n        return;\n      }\n    };\n\n    var req = http.request(options, cb)\n    req.write('{\"state\":\"KILLED\"}');\n    req.on('error', function(error) {\n      callback(error);\n    });\n    req.end();\n  }\n};\n"
  },
  {
    "path": "lib/shib/engines/yarn/index.js",
    "content": "var YARNClient = require('./client').YARNClient;\n\nvar Monitor = exports.Monitor = function(conf, logger) {\n  if (conf.name !== 'yarn')\n    throw \"monitor name mismatch for yarn:\" + conf.name;\n\n  if (!conf.host || !conf.port) {\n    throw \"YARN WebUI host/port not specified\";\n  }\n  var yarn = conf.yarn;\n  this.logger = logger;\n  this._client = new YARNClient(conf.host, conf.port, yarn);\n};\n\nMonitor.prototype.end = function(){\n};\n\nMonitor.prototype.supports = function(operation){\n  switch (operation) {\n  case 'status':\n  case 'kill':\n    return true;\n  }\n  throw \"unknown operation name (for yarn.Monitor):\" + operation;\n};\n\nMonitor.prototype.status = function(jobname, callback){\n  this._client.status(jobname, callback);\n};\n\n// kill YARN application, and 'jobid' means application id\nMonitor.prototype.kill = function(jobid, callback){\n  this._client.kill(jobid, callback);\n};\n"
  },
  {
    "path": "lib/shib/huahin_client.js",
    "content": "var http = require('http');\n\nvar HuahinClient = exports.HuahinClient = function(host, port){\n  this.host = host;\n  this.port = port;\n};\n\nHuahinClient.prototype.listAll = function(callback){\n  return this.list('all', callback);\n};\n\nHuahinClient.prototype.list = function(type, callback){\n  var path = '/job/list';\n  switch(type) {\n  case 'failed':    path = '/job/list/failed'; break;\n  case 'killed':    path = '/job/list/killed'; break;\n  case 'prep':      path = '/job/list/prep'; break;\n  case 'running':   path = '/job/list/running'; break;\n  case 'succeeded': path = '/job/list/succeeded'; break;\n  }\n  this.request('GET', path, callback);\n};\n\nHuahinClient.prototype.status = function(jobid, callback){\n  this.request('GET', '/job/status/' + jobid, callback);\n};\n\nHuahinClient.prototype.detail = function(jobid, callback){\n  this.request('GET', '/job/detail/' + jobid, callback);\n};\n\nHuahinClient.prototype.kill = function(jobid, callback){\n  this.request('DELETE', '/job/kill/id/' + jobid, callback);\n};\n\nHuahinClient.prototype.killByName = function(jobname, callback){\n  this.request('DELETE', '/job/kill/name/' + jobname, callback);\n};\n\nHuahinClient.prototype.request = function(method, path, callback){\n  var options = {\n    host: this.host,\n    port: this.port,\n    path: path,\n    method: method\n  };\n  var cb = function(res){\n    if (res.statusCode >= 200 && res.statusCode < 300) {\n      if (res.headers['content-type'].match(/^application\\/json/)) {\n        var jsondata = '';\n        res.on('data', function(chunk){\n          jsondata += chunk;\n          var data = null;\n          try {\n            data = JSON.parse(jsondata);\n          }\n          catch (e) {\n            /* jsondata is not complete */\n            data = null;\n          }\n          if (data) {\n            callback(null, {success: true, data: data});\n            jsondata = null;\n          }\n        });\n        return;\n      }\n      callback(null, {success: true});\n      return;\n    }\n    callback({message: \"Huahin Manager returns response code \" + res.statusCode});\n  };\n  var errcb = function(e){ callback(e, null); };\n  http.request(options, cb).on('error', errcb).end();\n};\n"
  },
  {
    "path": "lib/shib/index.js",
    "content": "var client = require('./client')\n  , auth = require('./auth')\n  , logger = require('./logger');\n\nvar default_configs = {\n  listen: 3000,\n  fetch_lines: 1000,\n  query_timeout: null,\n  setup_queries: [],\n  setup_queries_auth: [],\n  max_result_file_byte_size: null,\n  storage: {\n    datadir: './var'\n  },\n  disable_history: false,\n  auth: null,\n  engines: [\n    {\n      label: 'hive',\n      executer: {\n        name: 'hiveserver',\n        host: 'localhost',\n        port: 10000,\n        support_database: true,\n        default_database: 'default',\n        query_timeout: null,\n        setup_queries: [],\n        setup_queries_auth: []\n      },\n      monitor: null\n    }\n  ]\n};\n\nvar config = null;\nvar log = null;\n\nexports.init = function(arg){\n  var merge = function(destination, source) {\n    for (var property in source) {\n      if (source.hasOwnProperty(property)) {\n        destination[property] = source[property];\n      }\n    }\n    return destination;\n  };\n  config = merge(merge({}, default_configs), arg);\n\n  log = new logger.Logger(config.logger || {});\n};\n\nexports.setting = function(key){\n  return config[key];\n};\n\nexports.client = function(arg){\n  if (!arg)\n    arg = {};\n  return new client.Client(config, log, arg.credential);\n};\n\nexports.auth = function(arg){\n  return new auth.Auth(config.auth || {}, log);\n};\n\nexports.logger = function(){\n  return log;\n};\n"
  },
  {
    "path": "lib/shib/localdiskstore.js",
    "content": "var fs = require('fs'),\n    async = require('async'),\n    sqlite3 = require('sqlite3');\n\nvar Query = require('./query').Query;\n\nvar DATABASE_SQLITE_FILENAME = 'database.sqlite3';\n\n/*\n * v0 data schema:\n * * results raw data -> ${datadir}/results/char[0]/char[1]/resultid\n * queries/results/history/tags -> ${datadir}/database\n *  [queries] id -> json\n *  [results] id -> json\n *  [history] id, datetime, queryid\n *  [tags]    id, queryid, tag\n */\nvar SQLITE_TABLE_DEFINITIONS_v0 = [\n  'CREATE TABLE IF NOT EXISTS queries (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS results (id VARCHAR(32) NOT NULL PRIMARY KEY, json TEXT NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS history (id INTEGER PRIMARY KEY AUTOINCREMENT, yyyymm VARCHAR(6) NOT NULL, queryid VARCHAR(32) NOT NULL)',\n  'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\n];\n\n/*\n * v1 data schema:\n * * results raw data -> ${datadir}/results/char[0]/char[1]/resultid\n * queries/tags -> ${datadir}/database\n * [queries] id -> auto_increment_id, datetime(new Date().toJSON(), Zulu), expression, state, resultid, result(JSON)\n */\nvar SQLITE_TABLE_DEFINITIONS = [\n  '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)',\n  'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\n];\n\nvar KNOWN_TABLES = ['queries', 'tags', 'sqlite_sequence'];\n/*\n ** \"SELECT name FROM sqlite_master WHERE type='table'\"\n [ { name: 'queries' },\n   { name: 'sqlite_sequence' },\n   { name: 'tags' } ]\n */\n\nvar sqlite_initialized = false; // this variable is changed as 'true' when first initialize executed.\n\nvar SchemaVersionError = exports.SchemaVersionError = function(msg){\n  this.name = 'SchemaVersionError';\n  Error.call(this, msg);\n  Error.captureStackTrace(this, arguments.callee);\n};\nSchemaVersionError.prototype.__proto__ = Error.prototype;\n\nvar LocalDiskStoreError = exports.LocalDiskStoreError = function(msg){\n  this.name = 'LocalDiskStoreError';\n  Error.call(this, msg);\n  Error.captureStackTrace(this, arguments.callee);\n};\nLocalDiskStoreError.prototype.__proto__ = Error.prototype;\n\nvar LocalDiskStore = exports.LocalDiskStore = function(datadir, logger) {\n  this.datadir = fs.realpathSync(datadir);\n  this.logger = logger;\n\n  if (! this.datadir )\n    throw new LocalDiskStoreError(\"Invalid datadir path: \" + datadir);\n\n  var self = this;\n\n  var stat = fs.statSync(this.datadir);\n  if (! stat) {\n    fs.mkdirSync(this.datadir);\n  } else if (! stat.isDirectory()) {\n    throw new LocalDiskStoreError(\"Specified path is not directory: \" + datadir);\n  }\n\n  var db;\n  var on_connect = function(error){\n    if (error) {\n      self.logger.error(\"failed to open sqlite3\", error);\n      throw new LocalDiskStoreError(\"sqlite3 database open error:\" + error.message);\n    }\n    if (!db) {\n      self.logger.error(\"failed to initialize database\");\n      throw new LocalDiskStoreError(\"db variable is unset, maybe not initialized\"); }\n  };\n  if (!sqlite_initialized) {\n    on_connect = function(error){\n      if (error) {\n        self.logger.error(\"failed to open sqlite3\", error);\n        throw new LocalDiskStoreError(\"sqlite3 database open error:\" + error.message);\n      }\n      if (!db) {\n        self.logger.error(\"failed to initialize database\");\n        throw new LocalDiskStoreError(\"db variable is unset, maybe not initialized\");\n      }\n      var schemaChecker = function(cb){\n        db.all(\"SELECT name FROM sqlite_master WHERE type='table'\", function(err, rows){\n          if (err) { cb(err.message); return; }\n          if (rows.some(function(row){ return KNOWN_TABLES.indexOf(row.name) < 0; })) {\n            self.logger.error(\"Database schema is of v0.\");\n            self.logger.error('EXECUTE: \"npm run-script migrate\"');\n            throw new SchemaVersionError();\n          }\n          cb(null);\n        });\n      };\n      var setup = [schemaChecker].concat(SQLITE_TABLE_DEFINITIONS.map(function(sql){\n\t    return function(callback) {\n          db.run(sql, function(error){\n            if (error) { callback(error.message); return; }\n            callback(null);\n          });\n\t    };\n      }));\n      async.series(setup, function(err,results){\n\t    if (err) {\n          self.logger.error(\"failed to initialize database\", err);\n          throw new LocalDiskStoreError(\"database initialize failed\");\n        }\n        sqlite_initialized = true;\n      });\n    };\n  }\n\n  db = this.db = new sqlite3.Database(\n    datadir + '/' + DATABASE_SQLITE_FILENAME,\n    (sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE),\n    on_connect\n  );\n};\n\nLocalDiskStore.prototype.close = function(){\n  this.db.close();\n};\n\n// operations with sqlite3\n\nfunction generatePlaceholders(num) {\n  if (num < 1)\n    throw \"placeholder num must bigger than zero\";\n  var p = '?';\n  for (var i = 1; i < num; i++) {\n    p = p.concat(',?');\n  }\n  return p;\n}\n\n// '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)',\nLocalDiskStore.prototype.query = function(queryid, callback){\n  var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE id=?';\n  this.db.get(sql, [queryid], function(err,row){\n    if (err) { callback(err); return; }\n    if (!row) { callback(null, null); return; }\n    callback(null, new Query(row));\n  });\n};\n\nLocalDiskStore.prototype.queryByResultId = function(resultid, callback){\n  var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE resultid=?';\n  this.db.get(sql, [resultid], function(err,row){\n    if (err) { callback(err); return; }\n    if (!row) { callback(null, null); return; }\n    callback(null, new Query(row));\n  });\n};\n\nLocalDiskStore.prototype.queries = function(queryids, callback){\n  var placeholders = '(' + generatePlaceholders(queryids.length) + ')';\n  var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE id IN ' + placeholders;\n  this.db.all(sql, queryids, function(err,rows){\n    if (err) { callback(err); return; }\n    callback(null, rows.map(function(r){ return new Query(r);}));\n  });\n};\n\nLocalDiskStore.prototype.insertQuery = function(query, callback){\n  var sql = 'INSERT INTO queries (id,datetime,scheduled,engine,dbname,expression,state,resultid,result) VALUES (?,?,?,?,?,?,?,?,?)';\n  this.db.run(sql, query.serialized(), function(err){\n    if (callback) callback(err);\n  });\n};\n\nLocalDiskStore.prototype.updateQuery = function(query, callback){\n  this.db.run('UPDATE queries SET state=?, result=? WHERE id=?', query.serializedForUpdate(), function(err){\n    if (callback) callback(err);\n  });\n};\n\nLocalDiskStore.prototype.deleteQuery = function(queryid, callback){\n  this.db.run('DELETE FROM queries WHERE id=?', [queryid], function(err){\n    if (callback) callback(err);\n  });\n};\n\nLocalDiskStore.prototype.recentQueries = function(num, callback){\n  var sql = 'SELECT id,datetime,engine,dbname,expression,state,resultid,result FROM queries WHERE scheduled IS NULL ORDER BY datetime DESC LIMIT ' + parseInt(num);\n  var db = this.db;\n  this.db.all(sql, function(err, rows){\n    if (err) { callback(err); return; }\n    callback(null, rows.map(function(r){ return new Query(r); }));\n  });\n};\n\n// 'CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY AUTOINCREMENT, queryid VARCHAR(32) NOT NULL, tag VARCHAR(16) NOT NULL)'\nLocalDiskStore.prototype.tagList = function(callback){\n  this.db.all('SELECT DISTINCT tag FROM tags ORDER BY tag', function(err, rows){\n    if (err) { callback(err); return; }\n    callback(null, rows.map(function(obj){ return obj.tag; }));\n  });\n};\n\nLocalDiskStore.prototype.taggedQueries = function(tag, callback){\n  this.db.all('SELECT queryid FROM tags WHERE tag=?', [tag], function(err, rows){\n    if (err) { callback(err); return; }\n    callback(null, rows.map(function(obj){ return obj.queryid; }));\n  });\n};\n\nLocalDiskStore.prototype.tags = function(queryid, callback){\n  this.db.all('SELECT tag FROM tags WHERE queryid=?', [queryid], function(err, rows){\n    if (err) { callback(err); return; }\n    callback(null, rows.map(function(obj){ return obj.tag; }));\n  });\n};\n\nLocalDiskStore.prototype.addTag = function(queryid, tag, callback){\n  var self = this;\n  this.db.all('SELECT queryid, tag FROM tags WHERE queryid=? AND tag=?', [queryid, tag], function(err, rows){\n    if (err) { callback(err); return; }\n    if (rows && rows.length > 0) {\n      // specified tag already exists: ignore\n      if (callback) callback(null);\n      return;\n    }\n    self.db.run('INSERT INTO tags (queryid,tag) VALUES (?,?)', [queryid, tag], function(err){\n      if (callback) callback(err);\n    });\n  });\n};\n\nLocalDiskStore.prototype.deleteTag = function(queryid, tag, callback){\n  this.db.run('DELETE FROM tags WHERE queryid=? AND tag=?', [queryid, tag], function(err){\n    if (callback) callback(err);\n  });\n};\n\nLocalDiskStore.prototype.deleteTagForQuery = function(queryid, callback){\n  this.db.run('DELETE FROM tags WHERE queryid=?', [queryid], function(err){\n    if (callback) callback(err);\n  });\n};\n\n/* result data path utilities */\nLocalDiskStore.prototype.generatePathElements = function(key){\n  return [this.datadir, 'results', key[0], key[1], key];\n};\n\nLocalDiskStore.prototype.generatePathFromElements = function(elements){\n  return elements.join(\"/\");\n};\n\nLocalDiskStore.prototype.generatePath = function(key){\n  return this.generatePathFromElements(this.generatePathElements(key));\n};\n\nLocalDiskStore.prototype.keyExists = function(key){\n  return fs.existsSync(this.generatePath(key));\n};\n\nLocalDiskStore.prototype.prepare = function(key, callback){\n  var elements = this.generatePathElements(key);\n  elements.pop(); // purge file basename (is not target for mkdir)\n\n  var store = this;\n  var dig = function(elements, depth, cb){\n    var path = store.generatePathFromElements(elements.slice(0,depth));\n    fs.exists(path, function(exists){\n      if (!exists) {\n        fs.mkdir(path, function(){ cb(depth); });\n        return;\n      }\n      cb(depth);\n    });\n  };\n  var dig_callback = function(digged){\n    if (digged < elements.length) {\n      dig(elements, digged + 1, dig_callback);\n      return;\n    }\n    callback();\n  };\n  dig(elements, 1, dig_callback);\n};\n\nLocalDiskStore.prototype.readResultData = function(key, callback){\n  if (! this.keyExists(key)) { callback(null,null); return; }\n\n  var path = this.generatePath(key);\n  fs.readFile(path, 'utf8', function(err, data){\n    callback(err, data);\n  });\n};\n\nLocalDiskStore.prototype.writeResultData = function(key, data, callback){\n  if (this.keyExists(key)) {\n    this.logger.warn(\"specified result data to write is already exists\", {key: key});\n    callback({message:\"specified result data to write is already exists, key:\" + key});\n    return;\n  }\n\n  var path = this.generatePath(key);\n  this.prepare(key, function(){\n    fs.writeFile(path, data, 'utf8', function(err){\n      callback(err);\n    });\n  });\n};\n\nLocalDiskStore.prototype.appendResultData = function(key, data, callback){\n  var path = this.generatePath(key);\n  this.prepare(key, function(){\n    fs.appendFile(path, data, 'utf8', function(err){\n      callback(err);\n    });\n  });\n};\n\nLocalDiskStore.prototype.deleteResultData = function(key, callback){\n  var path = this.generatePath(key);\n  fs.exists(path, function(exists){\n    if (exists)\n      fs.unlink(path, callback);\n    else\n      callback(null);\n  });\n};"
  },
  {
    "path": "lib/shib/logger.js",
    "content": "var util = require('util');\n\nvar TRACE = 0\n  , DEBUG = 1\n  , INFO = 2\n  , WARN = 3\n  , ERROR = 4\n  , FATAL = 5;\n\nvar LOGLEVELS = ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'];\n\nvar LOG_FORMAT_SIMPLE    = \"%s [%s] : %s\"\n  , LOG_FORMAT_WITH_DUMP = \"%s [%s] : %s, %s\";\n\nvar Logger = exports.Logger = function(args){\n  this.level = args.level || INFO;\n};\n\nLogger.prototype.log = function(level, msg, optional){\n  if (level < this.level)\n    return;\n\n  var date = new Date();\n  var log_string;\n\n  if (optional)\n    log_string = util.format(LOG_FORMAT_WITH_DUMP, date.toLocaleString(), LOGLEVELS[level], msg, util.inspect(optional));\n  else\n    log_string = util.format(LOG_FORMAT_SIMPLE, date.toLocaleString(), LOGLEVELS[level], msg);\n\n  util.puts(log_string);\n};\n\nLogger.prototype.trace = function(msg, optional){\n  this.log(TRACE, msg, optional);\n};\n\nLogger.prototype.debug = function(msg, optional){\n  this.log(DEBUG, msg, optional);\n};\n\nLogger.prototype.info = function(msg, optional){\n  this.log(INFO, msg, optional);\n};\n\nLogger.prototype.warn = function(msg, optional){\n  this.log(WARN, msg, optional);\n};\n\nLogger.prototype.error = function(msg, optional){\n  this.log(ERROR, msg, optional);\n};\n\nLogger.prototype.fatal = function(msg, optional){\n  this.log(FATAL, msg, optional);\n};\n"
  },
  {
    "path": "lib/shib/query.js",
    "content": "var crypto = require('crypto');\n\nvar STATE_RUNNING = \"running\",\n    STATE_DONE = \"done\",\n    STATE_ERROR = \"error\";\n\nvar removeNewLines = exports.removeNewLines = function(str){\n  return str.split(/\\r\\n|\\r|\\n/).join(' ');\n};\nvar removeNewLinesAndComments = exports.removeNewLinesAndComments = function(str){\n  return str.replace(/--.*$/mg, '').split(/\\r\\n|\\r|\\n/).join(' ');\n};\n\nvar InvalidQueryError = exports.InvalidQueryError = function(msg){\n  this.name = 'InvalidQueryError';\n  this.message = msg;\n  Error.captureStackTrace(this, arguments.callee);\n};\nInvalidQueryError.prototype = Error.prototype;\n\nvar Query = exports.Query = function(args){\n  if (args.querystring)\n    Query.checkQueryString(args.querystring);\n\n  // 'SELECT id,datetime,scheduled,engine,dbname,expression,state,resultid,result FROM queries';\n\n  this.querystring = args.expression || args.querystring;\n\n  this.queryid = args.id || args.queryid || Query.generateQueryId(this.querystring, args.seed);\n\n  this.datetime = new Date();\n  if (args.datetime)\n    this.datetime = new Date(args.datetime);\n\n  this.scheduled = null;\n  if (args.scheduled)\n    this.scheduled = 1;\n\n  this.engine = args.engine;\n  this.dbname = args.dbname;\n  this.auth = args.auth;\n\n  this.state = args.state || STATE_RUNNING;\n\n  this.resultid = args.resultid || Query.generateResultId(this.queryid, this.datetime.toLocaleString());\n  if (args.result && typeof(args.result) == 'string')\n    this.result = Query.generateResult({json: args.result});\n  else if (args.result)\n    this.result = args.result;\n  else\n    this.result = Query.generateResult(null);\n};\n\nQuery.generateResult = function(args){\n  if (args === null)\n    args = {};\n\n  if (args.json) {\n    // Date object is weak to be stringified, and cannot be restored from JSON.parse()\n    // loaded result object does not have executed_time/completed_time\n    args = JSON.parse(args.json);\n    delete args.executed_time;\n    delete args.completed_time;\n  }\n\n  var r = {};\n\n  r.error = args.error || \"\";\n  r.lines = args.lines || null;\n  r.bytes = args.bytes || null;\n\n  r.completed_at = args.completed_at || null;\n  r.completed_msec = args.completed_msec || null;\n  if (! r.completed_msec && r.completed_at)\n    r.completed_msec = new Date(r.completed_at).getTime();\n\n  /* [ { name: 'x', type: 'string', comment: null },\n       { name: 'cnt', type: 'bigint', comment: null } ] */\n  r.schema = args.schema || [];\n\n  return r;\n};\n\nQuery.prototype.running = function(){\n  return this.state === STATE_RUNNING;\n};\n\nQuery.prototype.withError = function(){\n  if (this.state === STATE_DONE || this.state === STATE_ERROR)\n    return this.state === STATE_ERROR;\n  throw new Error(\"called without done/error status\");\n};\n\nQuery.prototype.markAsExecuted = function(err, lines, bytes){\n  if (err) {\n    this.state = STATE_ERROR;\n    this.result.error = err.message;\n  }\n  else {\n    this.state = STATE_DONE;\n  }\n\n  if (lines)\n    this.result.lines = lines;\n  if (bytes)\n    this.result.bytes = bytes;\n\n  this.result.completed_time = new Date();\n  this.result.completed_msec = this.result.completed_time.getTime();\n  this.result.completed_at = this.result.completed_time.toLocaleString();\n};\n\nQuery.prototype.addSchema = function(schemaData){\n  this.result.schema = schemaData;\n};\n\nQuery.prototype.serializedResult = function(){\n  // Date object is weak to be stringified, and cannot be restored from JSON.parse()\n  // loaded result object does not have executed_time/completed_time\n  var result = this.result;\n  delete result.executed_time;\n  delete result.completed_time;\n  return JSON.stringify(result);\n};\n\nQuery.prototype.serialized = function(){\n  return [\n    this.queryid,\n    this.datetime.toJSON(),\n    this.scheduled,\n    this.engine,\n    this.dbname,\n    this.querystring,\n    this.state,\n    this.resultid,\n    this.serializedResult()\n  ];\n};\n\nQuery.prototype.serializedForUpdate = function(){\n  // UPDATE queries SET state=?, result=? WHERE id=?\n  return [\n    this.state,\n    this.serializedResult(),\n    this.queryid\n  ];\n};\n\nQuery.prototype.composed = function(){\n  var q = this.querystring;\n\n  var dateformat = function(format, date) {\n    function pad2(n){return n < 10 ? '0' + n : n ;}\n    switch(format) {\n    case '%Y%m%d':\n      return date.getFullYear() + pad2(date.getMonth() + 1) + pad2(date.getDate());\n    case '%Y%m':\n      return date.getFullYear() + pad2(date.getMonth() + 1);\n    }\n    return undefined;\n  };\n  var d = new Date();\n\n  var today = dateformat('%Y%m%d', d);\n  var month = dateformat('%Y%m', d);\n  var yesterday = dateformat('%Y%m%d', new Date(d - 86400000));\n  var lastmonth = dateformat('%Y%m', new Date(d - 86400000 * (d.getDate() + 1)));\n  q = q.replace(/__TODAY__/g, today)\n       .replace(/__YESTERDAY__/g, yesterday)\n       .replace(/__MONTH__/g, month)\n       .replace(/__LASTMONTH__/g, lastmonth);\n\n  var re = /__(\\d)DAYS_AGO__/;\n  var match;\n  while ((match = re.exec(q)) !== null) {\n    var regexp = RegExp('__' + match[1] + 'DAYS_AGO__', 'g');\n    q = q.replace(regexp, dateformat('%Y%m%d', new Date(d - 86400000 * parseInt(match[1]))));\n  }\n  return q;\n};\n\nQuery.checkQueryString = function(querystring){\n  if (! querystring || querystring.length < 1) {\n    throw new InvalidQueryError(\"Blank or too short query.\");\n  }\n  if (querystring.indexOf(';') >= 0) {\n    throw new InvalidQueryError(\"Two or more queries detected! Semicolon prohibited.\");\n  }\n  // query type of create/drop/..../alter/load/insert/explain too many query types!!!\n  // white list now...\n  if (/^\\s*(with .*)?\\s*(explain\\s+)?select .* from .+$/i.exec(removeNewLinesAndComments(querystring))){\n    return;\n  }\n  throw new InvalidQueryError(\"Invalid query type. Allowed methods: 'SELECT', 'EXPLAIN'.\");\n};\n\nQuery.parseTableNames = function(querystring){\n  var result = [];\n\n  var regexp = /\\s(?:FROM|JOIN)\\s+([_.a-zA-Z0-9]+)/img; // ignoreCase, multiline, global\n  var match;\n  while ( (match = regexp.exec(querystring)) ) {\n    var specified = match[1];\n    if (specified.indexOf('.') != -1) {\n      result.push( specified.split(\".\", 2).reverse() );\n    } else {\n      result.push( [ specified, null] );\n    }\n  }\n\n  return result;\n};\n\nQuery.generateQueryId = function(querystring, seed){\n  if (!seed)\n    seed = '';\n  var md5sum = crypto.createHash('md5');\n  md5sum.update(new Buffer(querystring + ';' + seed, 'utf8'));\n  return md5sum.digest('hex');\n};\n\nQuery.generateResultId = function(queryid, executed_at) {\n  var md5sum = crypto.createHash('md5');\n  md5sum.update(new Buffer(queryid + executed_at, 'utf8'));\n  return md5sum.digest('hex');\n};\n\n"
  },
  {
    "path": "lib/shib/simple_csv_builder.js",
    "content": "var SimpleCSVBuilder = exports.SimpleCSVBuilder = function(args){\n};\n\nSimpleCSVBuilder.escape = function(value){\n  return String(value).replace(/\"/g, '\"\"');\n};\n\nSimpleCSVBuilder.build = function(data){\n  if (data.length < 1)\n    return '';\n  var values = [];\n  for(var i = 0; i < data.length; i++) {\n    var d = data[i];\n    if (d === undefined || d === null)\n      d = '';\n    values.push('\"' + SimpleCSVBuilder.escape(d) + '\"');\n  }\n  return values.join(',') + '\\n';\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"shib\",\n  \"version\": \"1.0.0\",\n  \"engines\": {\n    \"node\": \">= 0.8\"\n  },\n  \"description\": \"Hive Client Web Application\",\n  \"homepage\": \"https://github.com/tagomoris/shib\",\n  \"author\": \"TAGOMORI Satoshi <tagomoris@gmail.com>\",\n  \"keywords\": [\n    \"hive\",\n    \"hadoop\"\n  ],\n  \"directories\": {\n    \"lib\": \"./lib\",\n    \"views\": \"./views\",\n    \"public\": \"./public\",\n    \"bin\": \"./bin\"\n  },\n  \"files\": [\n    \"README.md\",\n    \"app.js\",\n    \"config.js\"\n  ],\n  \"dependencies\": {\n    \"async\": \">= 0.1.22\",\n    \"bignumber.js\": \">= 1.4.1\",\n    \"cheerio\": \">= 0.17.0\",\n    \"csv\": \">= 0.0.13\",\n    \"express\": \"~> 3.1.1\",\n    \"gcloud\": \"^0.12.0\",\n    \"jade\": \">= 0.26.1\",\n    \"json-bigint\": \">= 0.1.4\",\n    \"node-thrift\": \">= 1.0.0-dev\",\n    \"presto-client\": \"git://github.com/wyukawa/presto-client-node.git#timezone\",\n    \"sqlite3\": \">= 2.1.5\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/tagomoris/shib.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/tagomoris/shib/issues\"\n  },\n  \"licenses\": [\n    {\n      \"type\": \"APLv2\"\n    }\n  ],\n  \"scripts\": {\n    \"start\": \"NODE_PATH=lib node app.js\",\n    \"test\": \"NODE_PATH=lib node_modules/nodeunit/bin/nodeunit test/*.js\",\n    \"purge\": \"node bin/purge.js var/database.sqlite3\",\n    \"migrate\": \"node bin/dbmigrate.js var/database.sqlite3\"\n  },\n  \"main\": \"app.js\",\n  \"devDependencies\": {\n    \"nodeunit\": \"~0.8.6\"\n  }\n}\n"
  },
  {
    "path": "public/css/redmond/jquery-ui-1.8.13.custom.css",
    "content": "/*\n * jQuery UI CSS Framework 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Theming/API\n */\n\n/* Layout helpers\n----------------------------------*/\n.ui-helper-hidden { display: none; }\n.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }\n.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }\n.ui-helper-clearfix:after { content: \".\"; display: block; height: 0; clear: both; visibility: hidden; }\n.ui-helper-clearfix { display: inline-block; }\n/* required comment for clearfix to work in Opera \\*/\n* html .ui-helper-clearfix { height:1%; }\n.ui-helper-clearfix { display:block; }\n/* end clearfix */\n.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }\n\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-disabled { cursor: default !important; }\n\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Overlays */\n.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }\n\n\n/*\n * jQuery UI CSS Framework 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Theming/API\n *\n * 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\n */\n\n\n/* Component containers\n----------------------------------*/\n.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }\n.ui-widget .ui-widget { font-size: 1em; }\n.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }\n.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; }\n.ui-widget-content a { color: #222222; }\n.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; }\n.ui-widget-header a { color: #ffffff; }\n\n/* Interaction states\n----------------------------------*/\n.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; }\n.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; }\n.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; }\n.ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; }\n.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; }\n.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; }\n.ui-widget :active { outline: none; }\n\n/* Interaction Cues\n----------------------------------*/\n.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; }\n.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }\n.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; }\n.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }\n.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }\n.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }\n.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }\n.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }\n.ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }\n.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }\n.ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }\n.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }\n.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }\n.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }\n.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }\n\n/* positioning */\n.ui-icon-carat-1-n { background-position: 0 0; }\n.ui-icon-carat-1-ne { background-position: -16px 0; }\n.ui-icon-carat-1-e { background-position: -32px 0; }\n.ui-icon-carat-1-se { background-position: -48px 0; }\n.ui-icon-carat-1-s { background-position: -64px 0; }\n.ui-icon-carat-1-sw { background-position: -80px 0; }\n.ui-icon-carat-1-w { background-position: -96px 0; }\n.ui-icon-carat-1-nw { background-position: -112px 0; }\n.ui-icon-carat-2-n-s { background-position: -128px 0; }\n.ui-icon-carat-2-e-w { background-position: -144px 0; }\n.ui-icon-triangle-1-n { background-position: 0 -16px; }\n.ui-icon-triangle-1-ne { background-position: -16px -16px; }\n.ui-icon-triangle-1-e { background-position: -32px -16px; }\n.ui-icon-triangle-1-se { background-position: -48px -16px; }\n.ui-icon-triangle-1-s { background-position: -64px -16px; }\n.ui-icon-triangle-1-sw { background-position: -80px -16px; }\n.ui-icon-triangle-1-w { background-position: -96px -16px; }\n.ui-icon-triangle-1-nw { background-position: -112px -16px; }\n.ui-icon-triangle-2-n-s { background-position: -128px -16px; }\n.ui-icon-triangle-2-e-w { background-position: -144px -16px; }\n.ui-icon-arrow-1-n { background-position: 0 -32px; }\n.ui-icon-arrow-1-ne { background-position: -16px -32px; }\n.ui-icon-arrow-1-e { background-position: -32px -32px; }\n.ui-icon-arrow-1-se { background-position: -48px -32px; }\n.ui-icon-arrow-1-s { background-position: -64px -32px; }\n.ui-icon-arrow-1-sw { background-position: -80px -32px; }\n.ui-icon-arrow-1-w { background-position: -96px -32px; }\n.ui-icon-arrow-1-nw { background-position: -112px -32px; }\n.ui-icon-arrow-2-n-s { background-position: -128px -32px; }\n.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }\n.ui-icon-arrow-2-e-w { background-position: -160px -32px; }\n.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }\n.ui-icon-arrowstop-1-n { background-position: -192px -32px; }\n.ui-icon-arrowstop-1-e { background-position: -208px -32px; }\n.ui-icon-arrowstop-1-s { background-position: -224px -32px; }\n.ui-icon-arrowstop-1-w { background-position: -240px -32px; }\n.ui-icon-arrowthick-1-n { background-position: 0 -48px; }\n.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }\n.ui-icon-arrowthick-1-e { background-position: -32px -48px; }\n.ui-icon-arrowthick-1-se { background-position: -48px -48px; }\n.ui-icon-arrowthick-1-s { background-position: -64px -48px; }\n.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }\n.ui-icon-arrowthick-1-w { background-position: -96px -48px; }\n.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }\n.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }\n.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }\n.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }\n.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }\n.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }\n.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }\n.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }\n.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }\n.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }\n.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }\n.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }\n.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }\n.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }\n.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }\n.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }\n.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }\n.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }\n.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }\n.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }\n.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }\n.ui-icon-arrow-4 { background-position: 0 -80px; }\n.ui-icon-arrow-4-diag { background-position: -16px -80px; }\n.ui-icon-extlink { background-position: -32px -80px; }\n.ui-icon-newwin { background-position: -48px -80px; }\n.ui-icon-refresh { background-position: -64px -80px; }\n.ui-icon-shuffle { background-position: -80px -80px; }\n.ui-icon-transfer-e-w { background-position: -96px -80px; }\n.ui-icon-transferthick-e-w { background-position: -112px -80px; }\n.ui-icon-folder-collapsed { background-position: 0 -96px; }\n.ui-icon-folder-open { background-position: -16px -96px; }\n.ui-icon-document { background-position: -32px -96px; }\n.ui-icon-document-b { background-position: -48px -96px; }\n.ui-icon-note { background-position: -64px -96px; }\n.ui-icon-mail-closed { background-position: -80px -96px; }\n.ui-icon-mail-open { background-position: -96px -96px; }\n.ui-icon-suitcase { background-position: -112px -96px; }\n.ui-icon-comment { background-position: -128px -96px; }\n.ui-icon-person { background-position: -144px -96px; }\n.ui-icon-print { background-position: -160px -96px; }\n.ui-icon-trash { background-position: -176px -96px; }\n.ui-icon-locked { background-position: -192px -96px; }\n.ui-icon-unlocked { background-position: -208px -96px; }\n.ui-icon-bookmark { background-position: -224px -96px; }\n.ui-icon-tag { background-position: -240px -96px; }\n.ui-icon-home { background-position: 0 -112px; }\n.ui-icon-flag { background-position: -16px -112px; }\n.ui-icon-calendar { background-position: -32px -112px; }\n.ui-icon-cart { background-position: -48px -112px; }\n.ui-icon-pencil { background-position: -64px -112px; }\n.ui-icon-clock { background-position: -80px -112px; }\n.ui-icon-disk { background-position: -96px -112px; }\n.ui-icon-calculator { background-position: -112px -112px; }\n.ui-icon-zoomin { background-position: -128px -112px; }\n.ui-icon-zoomout { background-position: -144px -112px; }\n.ui-icon-search { background-position: -160px -112px; }\n.ui-icon-wrench { background-position: -176px -112px; }\n.ui-icon-gear { background-position: -192px -112px; }\n.ui-icon-heart { background-position: -208px -112px; }\n.ui-icon-star { background-position: -224px -112px; }\n.ui-icon-link { background-position: -240px -112px; }\n.ui-icon-cancel { background-position: 0 -128px; }\n.ui-icon-plus { background-position: -16px -128px; }\n.ui-icon-plusthick { background-position: -32px -128px; }\n.ui-icon-minus { background-position: -48px -128px; }\n.ui-icon-minusthick { background-position: -64px -128px; }\n.ui-icon-close { background-position: -80px -128px; }\n.ui-icon-closethick { background-position: -96px -128px; }\n.ui-icon-key { background-position: -112px -128px; }\n.ui-icon-lightbulb { background-position: -128px -128px; }\n.ui-icon-scissors { background-position: -144px -128px; }\n.ui-icon-clipboard { background-position: -160px -128px; }\n.ui-icon-copy { background-position: -176px -128px; }\n.ui-icon-contact { background-position: -192px -128px; }\n.ui-icon-image { background-position: -208px -128px; }\n.ui-icon-video { background-position: -224px -128px; }\n.ui-icon-script { background-position: -240px -128px; }\n.ui-icon-alert { background-position: 0 -144px; }\n.ui-icon-info { background-position: -16px -144px; }\n.ui-icon-notice { background-position: -32px -144px; }\n.ui-icon-help { background-position: -48px -144px; }\n.ui-icon-check { background-position: -64px -144px; }\n.ui-icon-bullet { background-position: -80px -144px; }\n.ui-icon-radio-off { background-position: -96px -144px; }\n.ui-icon-radio-on { background-position: -112px -144px; }\n.ui-icon-pin-w { background-position: -128px -144px; }\n.ui-icon-pin-s { background-position: -144px -144px; }\n.ui-icon-play { background-position: 0 -160px; }\n.ui-icon-pause { background-position: -16px -160px; }\n.ui-icon-seek-next { background-position: -32px -160px; }\n.ui-icon-seek-prev { background-position: -48px -160px; }\n.ui-icon-seek-end { background-position: -64px -160px; }\n.ui-icon-seek-start { background-position: -80px -160px; }\n/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */\n.ui-icon-seek-first { background-position: -80px -160px; }\n.ui-icon-stop { background-position: -96px -160px; }\n.ui-icon-eject { background-position: -112px -160px; }\n.ui-icon-volume-off { background-position: -128px -160px; }\n.ui-icon-volume-on { background-position: -144px -160px; }\n.ui-icon-power { background-position: 0 -176px; }\n.ui-icon-signal-diag { background-position: -16px -176px; }\n.ui-icon-signal { background-position: -32px -176px; }\n.ui-icon-battery-0 { background-position: -48px -176px; }\n.ui-icon-battery-1 { background-position: -64px -176px; }\n.ui-icon-battery-2 { background-position: -80px -176px; }\n.ui-icon-battery-3 { background-position: -96px -176px; }\n.ui-icon-circle-plus { background-position: 0 -192px; }\n.ui-icon-circle-minus { background-position: -16px -192px; }\n.ui-icon-circle-close { background-position: -32px -192px; }\n.ui-icon-circle-triangle-e { background-position: -48px -192px; }\n.ui-icon-circle-triangle-s { background-position: -64px -192px; }\n.ui-icon-circle-triangle-w { background-position: -80px -192px; }\n.ui-icon-circle-triangle-n { background-position: -96px -192px; }\n.ui-icon-circle-arrow-e { background-position: -112px -192px; }\n.ui-icon-circle-arrow-s { background-position: -128px -192px; }\n.ui-icon-circle-arrow-w { background-position: -144px -192px; }\n.ui-icon-circle-arrow-n { background-position: -160px -192px; }\n.ui-icon-circle-zoomin { background-position: -176px -192px; }\n.ui-icon-circle-zoomout { background-position: -192px -192px; }\n.ui-icon-circle-check { background-position: -208px -192px; }\n.ui-icon-circlesmall-plus { background-position: 0 -208px; }\n.ui-icon-circlesmall-minus { background-position: -16px -208px; }\n.ui-icon-circlesmall-close { background-position: -32px -208px; }\n.ui-icon-squaresmall-plus { background-position: -48px -208px; }\n.ui-icon-squaresmall-minus { background-position: -64px -208px; }\n.ui-icon-squaresmall-close { background-position: -80px -208px; }\n.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }\n.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }\n.ui-icon-grip-solid-vertical { background-position: -32px -224px; }\n.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }\n.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }\n.ui-icon-grip-diagonal-se { background-position: -80px -224px; }\n\n\n/* Misc visuals\n----------------------------------*/\n\n/* Corner radius */\n.ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }\n.ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }\n.ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }\n.ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }\n.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; }\n.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; }\n.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; }\n.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; }\n.ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }\n\n/* Overlays */\n.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }\n.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; }/*\n * jQuery UI Resizable 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Resizable#theming\n */\n.ui-resizable { position: relative;}\n.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;\n\t/* http://bugs.jqueryui.com/ticket/7233\n\t - Resizable: resizable handles fail to work in IE if transparent and content overlaps\n\t*/\n\tbackground-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);\n}\n.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }\n.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }\n.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }\n.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }\n.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }\n.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }\n.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }\n.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }\n.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*\n * jQuery UI Selectable 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Selectable#theming\n */\n.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }\n/*\n * jQuery UI Accordion 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Accordion#theming\n */\n/* IE/Win - Fix animation bug - #4615 */\n.ui-accordion { width: 100%; }\n.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }\n.ui-accordion .ui-accordion-li-fix { display: inline; }\n.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }\n.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }\n.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }\n.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }\n.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; }\n.ui-accordion .ui-accordion-content-active { display: block; }\n/*\n * jQuery UI Autocomplete 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Autocomplete#theming\n */\n.ui-autocomplete { position: absolute; cursor: default; }\t\n\n/* workarounds */\n* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */\n\n/*\n * jQuery UI Menu 1.8.13\n *\n * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Menu#theming\n */\n.ui-menu {\n\tlist-style:none;\n\tpadding: 2px;\n\tmargin: 0;\n\tdisplay:block;\n\tfloat: left;\n}\n.ui-menu .ui-menu {\n\tmargin-top: -3px;\n}\n.ui-menu .ui-menu-item {\n\tmargin:0;\n\tpadding: 0;\n\tzoom: 1;\n\tfloat: left;\n\tclear: left;\n\twidth: 100%;\n}\n.ui-menu .ui-menu-item a {\n\ttext-decoration:none;\n\tdisplay:block;\n\tpadding:.2em .4em;\n\tline-height:1.5;\n\tzoom:1;\n}\n.ui-menu .ui-menu-item a.ui-state-hover,\n.ui-menu .ui-menu-item a.ui-state-active {\n\tfont-weight: normal;\n\tmargin: -1px;\n}\n/*\n * jQuery UI Button 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Button#theming\n */\n.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 */\n.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */\nbutton.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */\n.ui-button-icons-only { width: 3.4em; } \nbutton.ui-button-icons-only { width: 3.7em; } \n\n/*button text element */\n.ui-button .ui-button-text { display: block; line-height: 1.4;  }\n.ui-button-text-only .ui-button-text { padding: .4em 1em; }\n.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }\n.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }\n.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }\n.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }\n/* no icon support for input elements, provide padding by default */\ninput.ui-button { padding: .4em 1em; }\n\n/*button icon element(s) */\n.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; }\n.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }\n.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; }\n.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; }\n.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }\n\n/*button sets*/\n.ui-buttonset { margin-right: 7px; }\n.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }\n\n/* workarounds */\nbutton.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */\n/*\n * jQuery UI Dialog 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Dialog#theming\n */\n.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }\n.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;  }\n.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } \n.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }\n.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }\n.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }\n.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }\n.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; }\n.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }\n.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }\n.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }\n.ui-draggable .ui-dialog-titlebar { cursor: move; }\n/*\n * jQuery UI Slider 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Slider#theming\n */\n.ui-slider { position: relative; text-align: left; }\n.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }\n.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }\n\n.ui-slider-horizontal { height: .8em; }\n.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }\n.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }\n.ui-slider-horizontal .ui-slider-range-min { left: 0; }\n.ui-slider-horizontal .ui-slider-range-max { right: 0; }\n\n.ui-slider-vertical { width: .8em; height: 100px; }\n.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }\n.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }\n.ui-slider-vertical .ui-slider-range-min { bottom: 0; }\n.ui-slider-vertical .ui-slider-range-max { top: 0; }/*\n * jQuery UI Tabs 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Tabs#theming\n */\n.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\") */\n.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }\n.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; }\n.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }\n.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }\n.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; }\n.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... */\n.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }\n.ui-tabs .ui-tabs-hide { display: none !important; }\n/*\n * jQuery UI Datepicker 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Datepicker#theming\n */\n.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }\n.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }\n.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }\n.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }\n.ui-datepicker .ui-datepicker-prev { left:2px; }\n.ui-datepicker .ui-datepicker-next { right:2px; }\n.ui-datepicker .ui-datepicker-prev-hover { left:1px; }\n.ui-datepicker .ui-datepicker-next-hover { right:1px; }\n.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;  }\n.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }\n.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }\n.ui-datepicker select.ui-datepicker-month-year {width: 100%;}\n.ui-datepicker select.ui-datepicker-month, \n.ui-datepicker select.ui-datepicker-year { width: 49%;}\n.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }\n.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }\n.ui-datepicker td { border: 0; padding: 1px; }\n.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }\n.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; }\n.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }\n\n/* with multiple calendars */\n.ui-datepicker.ui-datepicker-multi { width:auto; }\n.ui-datepicker-multi .ui-datepicker-group { float:left; }\n.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }\n.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }\n.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }\n.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }\n.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }\n.ui-datepicker-row-break { clear:both; width:100%; }\n\n/* RTL support */\n.ui-datepicker-rtl { direction: rtl; }\n.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }\n.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }\n.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group { float:right; }\n.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }\n\n/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */\n.ui-datepicker-cover {\n    display: none; /*sorry for IE5*/\n    display/**/: block; /*sorry for IE5*/\n    position: absolute; /*must have*/\n    z-index: -1; /*must have*/\n    filter: mask(); /*must have*/\n    top: -4px; /*must have*/\n    left: -4px; /*must have*/\n    width: 200px; /*must have*/\n    height: 200px; /*must have*/\n}/*\n * jQuery UI Progressbar 1.8.13\n *\n * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)\n * Dual licensed under the MIT or GPL Version 2 licenses.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Progressbar#theming\n */\n.ui-progressbar { height:2em; text-align: left; }\n.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }"
  },
  {
    "path": "public/css/shib.css",
    "content": "/* overwrite jquery-ui style */\n.ui-tabs .ui-tabs-panel {padding: 1px;}\n\nbody {font: 62.5% \"Trebuchet MS\", sans-serif; min-width: 980px; width: 98%;}\n\n/* css for test */\nul#icons1 {margin: 0; padding: 0;}\nul#icons1 li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}\nul#icons1 span.ui-icon {float: left; margin: 0 4px;}\nul#icons2 {margin: 0; padding: 0;}\nul#icons2 li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}\nul#icons2 span.ui-icon {float: left; margin: 0 4px;}\n/* *** */\n\n\nul.operationitems {margin: 0; padding: 0;}\nul.operationitems li {margin: 2px; position: relative; padding: 4px 8px 4px 4px; cursor: pointer; float: left;  list-style: none;}\nul.operationitems span.ui-icon {float: left; margin: 0 4px;}\n\nul.querytags {margin: 0; padding: 0;}\nul.querytags li {margin: 2px; position: relative; padding: 4px 8px 4px 4px; cursor: pointer; float: left;  list-style: none;}\nul.querytags span.ui-icon {float: left; margin: 0 4px;}\n\nspan.status_not_executed {font-weight: bold; color: orange;}\nspan.status_running {font-weight: bold; color: navy;}\nspan.status_executed {font-weight: bold; color: green;}\nspan.status_done {font-weight: bold; color: green;}\nspan.status_error {font-weight: bold; color: red;}\nspan.status_re-running {font-weight: bold; color: orange;}\n\n#titlearea {position: relative; min-width: 980px; width: 98%; margin-top: 15px; text-align: center;}\n#title {\n    font-family: 'Artifika', serif; font-size: 40px; font-style: normal; font-weight: 400;\n    text-align: center; text-shadow: none; text-decoration: none; text-transform: none;\n    letter-spacing: 0em; word-spacing: 0em; line-height: 1.2;\n}\n#title a {\n    text-decoration: none; color: black;\n}\nspan#subtitle {\n    font-size: 18px; font-style: normal; font-weight: 400;\n    letter-spacing: 0em; word-spacing: 0em; line-height: 1.2;\n}\n\n#noticearea {width: 50%; height: 5em; margin: 0px auto 2px auto;}\n#errorarea {margin: 0 0 0 0;}\n#infoarea {margin: 0 0 0 0;}\n\n#mainarea {position: relative; max-width: 980px; min-width: 750px; margin: -15px auto; }\ntd#mainviewcell {margin: 0; padding: 0; vertical-align: top;}\n#mainview {display: block; position: relative; clear: both; max-width: 560px; width: 560px; margin-right: 0px;}\ntd#tabviewcell {margin: 0; padding: 0; vertical-align: top;}\n#tabview {display: block; position: relative; clear: both; max-width: 420px; width: 420px; margin-left: 10px;}\n\n#runningarea {max-width: 980px; margin: 30px auto 10px auto; padding: .5em; text-align: center;}\n#runnings {border: 1px solid #c0c0f8; background-color: #f8f8ff;}\n\n#creditarea {margin: 10px auto; text-align: center;}\n\n/* for main view (left pane) */\n#querybox {}\n#queryeditor {\n    width: 100%; border: 1px solid #c0c0f8;\n    font-family: 'Anonymous Pro', serif;\n    font-size: 18px;\n    font-style: normal;\n    font-weight: 700;\n    text-decoration: none;\n    text-transform: none;\n    letter-spacing: 0em;\n    word-spacing: 0em;\n    line-height: 1.2;\n}\n#querybox textarea.readonly {background-color: #f0f0f0;}\n\n#keywordbox {display: none; width: 99%; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}\n#keywordbox div {display: none; fond-weight: bold; font-size: small; width: 100%;}\n#keywordbox div .keywordname {display: inline; width: 30%; text-align: right;}\n#keywordbox div input {margin-left: 1em; width: 40%; border: 1px solid #c0c0f8; font-size: medium;}\n#keywordbox div input.readonly {background-color: #f0f0f0;}\n\n#dangereditbox {width: 99%; margin-top: .5em; padding: .5em; border: 1px solid #c0c0f8; background-color: #fff0f0;}\n#editbox {width: 99%; margin-top: .5em; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}\n#statusview {margin: 10px; font-size: small;}\n#queryexec {margin: 10px; font-size: small;}\n#queryresult {margin: 10px; font-size: small;}\n\n#graphbox {margin-top: .5em; margin-bottom: .5em;}\n#graphboxdummy {width: 100%; border: 1px dotted gray;}\n#controlbox {width: 99%; padding: .5em; border: 1px solid #c0c0f8; background-color: #f8f8ff;}\n\n/* *** */\n\n/* for tab view (right pane) */\n.queryitem {padding-bottom: 2px; margin-bottom: 3px; border-bottom: 1px dotted;}\n.queryitem_selected {background-color: #fdfdf0;}\n.queryitem_information {width: 100%; font-weight: bold; background-color: #e8e8ef;}\n\n.queryitem_statement {\n  font-family: 'Inconsolata', serif;\n  /*\n  font-family: 'Allerta', serif;\n  font-family: 'Anonymous Pro', serif;\n  font-family: 'Cousine', serif;\n  */\n  font-size: 12px;\n  font-style: normal;\n  font-weight: 400;\n  text-shadow: none;\n  text-decoration: none;\n  text-transform: none;\n  letter-spacing: 0em;\n  word-spacing: 0em;\n  line-height: 1.2;\n}\n.queryitem_status {font-weight: bold; width: 100%;}\nspan.queryitem_etc {padding-left: 5px;}\n\n/* *** */\n"
  },
  {
    "path": "public/css/ui.dynatree.css",
    "content": "/*******************************************************************************\r\n * Tree container\r\n */\r\nul.dynatree-container\r\n{\r\n\tfont-family: tahoma, arial, helvetica;\r\n\tfont-size: 10pt; /* font size should not be too big */\r\n\twhite-space: nowrap;\r\n\tpadding: 3px;\r\n\r\n\tbackground-color: white;\r\n\tborder: 1px dotted gray;\r\n\r\n\toverflow: auto;\r\n}\r\n\r\nul.dynatree-container ul\r\n{\r\n\tpadding: 0 0 0 16px;\r\n\tmargin: 0;\r\n}\r\n\r\nul.dynatree-container li\r\n{\r\n\tlist-style-image: none;\r\n\tlist-style-position: outside;\r\n\tlist-style-type: none;\r\n\t-moz-background-clip:border;\r\n\t-moz-background-inline-policy: continuous;\r\n\t-moz-background-origin: padding;\r\n\tbackground-attachment: scroll;\r\n\tbackground-color: transparent;\r\n\tbackground-repeat: repeat-y;\r\n\tbackground-image: url(\"vline.gif\");\r\n\tbackground-position: 0 0;\r\n\t/*\r\n\tbackground-image: url(\"icons_96x256.gif\");\r\n\tbackground-position: -80px -64px;\r\n\t*/\r\n\tmargin: 0;\r\n\tpadding: 1px 0 0 0;\r\n}\r\n/* Suppress lines for last child node */\r\nul.dynatree-container li.dynatree-lastsib\r\n{\r\n\tbackground-image: none;\r\n}\r\n/* Suppress lines if level is fixed expanded (option minExpandLevel) */\r\nul.dynatree-no-connector > li\r\n{\r\n\tbackground-image: none;\r\n}\r\n\r\n/* Style, when control is disabled */\r\n.ui-dynatree-disabled ul.dynatree-container\r\n{\r\n\topacity: 0.5;\r\n/*\tfilter: alpha(opacity=50); /* Yields a css warning */\r\n\tbackground-color: silver;\r\n}\r\n\r\n/*******************************************************************************\r\n * Common icon definitions\r\n */\r\nspan.dynatree-empty,\r\nspan.dynatree-vline,\r\nspan.dynatree-connector,\r\nspan.dynatree-expander,\r\nspan.dynatree-icon,\r\nspan.dynatree-checkbox,\r\nspan.dynatree-radio,\r\nspan.dynatree-drag-helper-img,\r\n#dynatree-drop-marker\r\n{\r\n\twidth: 16px;\r\n\theight: 16px;\r\n\tdisplay: -moz-inline-box; /* @ FF 1+2 */\r\n\tdisplay: inline-block; /* Required to make a span sizeable */\r\n\tvertical-align: top;\r\n\tbackground-repeat: no-repeat;\r\n\tbackground-position: left;\r\n\tbackground-image: url(\"/image/jquery.dynatree/icons.gif\");\r\n\tbackground-position: 0 0;\r\n}\r\n\r\n/** Used by 'icon' node option: */\r\nul.dynatree-container img\r\n{\r\n\twidth: 16px;\r\n\theight: 16px;\r\n\tmargin-left: 3px;\r\n\tvertical-align: top;\r\n\tborder-style: none;\r\n}\r\n\r\n\r\n/*******************************************************************************\r\n * Lines and connectors\r\n */\r\n\r\nspan.dynatree-connector\r\n{\r\n\tbackground-position: -16px -64px;\r\n}\r\n\r\n/*******************************************************************************\r\n * Expander icon\r\n * Note: IE6 doesn't correctly evaluate multiples class names,\r\n *\t\t so we create combined class names that can be used in the CSS.\r\n *\r\n * Prefix: dynatree-exp-\r\n * 1st character: 'e': expanded, 'c': collapsed\r\n * 2nd character (optional): 'd': lazy (Delayed)\r\n * 3rd character (optional): 'l': Last sibling\r\n */\r\n\r\nspan.dynatree-expander\r\n{\r\n\tbackground-position: 0px -80px;\r\n\tcursor: pointer;\r\n}\r\n.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */\r\n{\r\n\tbackground-position: 0px -96px;\r\n}\r\n.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */\r\n{\r\n\tbackground-position: -64px -80px;\r\n}\r\n.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */\r\n{\r\n\tbackground-position: -64px -96px;\r\n}\r\n.dynatree-exp-e span.dynatree-expander,  /* Expanded, not delayed, not last sibling */\r\n.dynatree-exp-ed span.dynatree-expander  /* Expanded, delayed, not last sibling */\r\n{\r\n\tbackground-position: -32px -80px;\r\n}\r\n.dynatree-exp-el span.dynatree-expander,  /* Expanded, not delayed, last sibling */\r\n.dynatree-exp-edl span.dynatree-expander  /* Expanded, delayed, last sibling */\r\n{\r\n\tbackground-position: -32px -96px;\r\n}\r\n.dynatree-loading span.dynatree-expander  /* 'Loading' status overrides all others */\r\n{\r\n\tbackground-position: 0 0;\r\n\tbackground-image: url(\"/image/jquery.dynatree/loading.gif\");\r\n}\r\n\r\n\r\n/*******************************************************************************\r\n * Checkbox icon\r\n */\r\nspan.dynatree-checkbox\r\n{\r\n\tmargin-left: 3px;\r\n\tbackground-position: 0px -32px;\r\n}\r\nspan.dynatree-checkbox:hover\r\n{\r\n\tbackground-position: -16px -32px;\r\n}\r\n\r\n.dynatree-partsel span.dynatree-checkbox\r\n{\r\n\tbackground-position: -64px -32px;\r\n}\r\n.dynatree-partsel span.dynatree-checkbox:hover\r\n{\r\n\tbackground-position: -80px -32px;\r\n}\r\n\r\n.dynatree-selected span.dynatree-checkbox\r\n{\r\n\tbackground-position: -32px -32px;\r\n}\r\n.dynatree-selected span.dynatree-checkbox:hover\r\n{\r\n\tbackground-position: -48px -32px;\r\n}\r\n\r\n/*******************************************************************************\r\n * Radiobutton icon\r\n * This is a customization, that may be activated by overriding the 'checkbox'\r\n * class name as 'dynatree-radio' in the tree options.\r\n */\r\nspan.dynatree-radio\r\n{\r\n\tmargin-left: 3px;\r\n\tbackground-position: 0px -48px;\r\n}\r\nspan.dynatree-radio:hover\r\n{\r\n\tbackground-position: -16px -48px;\r\n}\r\n\r\n.dynatree-partsel span.dynatree-radio\r\n{\r\n\tbackground-position: -64px -48px;\r\n}\r\n.dynatree-partsel span.dynatree-radio:hover\r\n{\r\n\tbackground-position: -80px -48px;\r\n}\r\n\r\n.dynatree-selected span.dynatree-radio\r\n{\r\n\tbackground-position: -32px -48px;\r\n}\r\n.dynatree-selected span.dynatree-radio:hover\r\n{\r\n\tbackground-position: -48px -48px;\r\n}\r\n\r\n/*******************************************************************************\r\n * Node type icon\r\n * Note: IE6 doesn't correctly evaluate multiples class names,\r\n *\t\t so we create combined class names that can be used in the CSS.\r\n *\r\n * Prefix: dynatree-ico-\r\n * 1st character: 'e': expanded, 'c': collapsed\r\n * 2nd character (optional): 'f': folder\r\n */\r\n\r\nspan.dynatree-icon /* Default icon */\r\n{\r\n\tmargin-left: 3px;\r\n\tbackground-position: 0px 0px;\r\n}\r\n\r\n.dynatree-ico-cf span.dynatree-icon  /* Collapsed Folder */\r\n{\r\n\tbackground-position: 0px -16px;\r\n}\r\n\r\n.dynatree-ico-ef span.dynatree-icon  /* Expanded Folder */\r\n{\r\n\tbackground-position: -64px -16px;\r\n}\r\n\r\n/* Status node icons */\r\n\r\n.dynatree-statusnode-wait span.dynatree-icon\r\n{\r\n\tbackground-image: url(\"/image/jquery.dynatree/loading.gif\");\r\n}\r\n\r\n.dynatree-statusnode-error span.dynatree-icon\r\n{\r\n\tbackground-position: 0px -112px;\r\n/*\tbackground-image: url(\"/image/jquery.dynatree/ltError.gif\");*/\r\n}\r\n\r\n/*******************************************************************************\r\n * Node titles\r\n */\r\n\r\n/* @Chrome: otherwise hit area of node titles is broken (issue 133)\r\n   Removed again for issue 165; (133 couldn't be reproduced) */\r\nspan.dynatree-node\r\n{\r\n/*  display: -moz-inline-box; /* @ FF 1+2 */\r\n/*  display: inline-block; /* Required to make a span sizeable */\r\n}\r\n\r\n\r\n/* Remove blue color and underline from title links */\r\nul.dynatree-container a\r\n/*, ul.dynatree-container a:visited*/\r\n{\r\n\tcolor: black; /* inherit doesn't work on IE */\r\n\ttext-decoration: none;\r\n\tvertical-align: top;\r\n\tmargin: 0px;\r\n\tmargin-left: 3px;\r\n/*\toutline: 0; /* @ Firefox, prevent dotted border after click */\r\n}\r\n\r\nul.dynatree-container a:hover\r\n{\r\n/*\ttext-decoration: underline; */\r\n\tbackground: #F2F7FD; /* light blue */\r\n\tborder-color: #B8D6FB; /* darker light blue */\r\n}\r\n\r\nspan.dynatree-node a\r\n{\r\n\tdisplay: inline-block; /* Better alignment, when title contains <br> */\r\n/*\tvertical-align: top;*/\r\n\tpadding-left: 3px;\r\n\tpadding-right: 3px; /* Otherwise italic font will be outside bounds */\r\n\t/*\tline-height: 16px; /* should be the same as img height, in case 16 px */\r\n}\r\nspan.dynatree-folder a\r\n{\r\n\tfont-weight: bold;\r\n}\r\n\r\nul.dynatree-container a:focus,\r\nspan.dynatree-focused a:link  /* @IE */\r\n{\r\n\tbackground-color: #EFEBDE; /* gray */\r\n}\r\n\r\nspan.dynatree-has-children a\r\n{\r\n}\r\n\r\nspan.dynatree-expanded a\r\n{\r\n}\r\n\r\nspan.dynatree-selected a\r\n{\r\n\tcolor: green;\r\n\tfont-style: italic;\r\n}\r\n\r\nspan.dynatree-active a\r\n{\r\n\tbackground-color: #3169C6 !important;\r\n\tcolor: white !important; /* @ IE6 */\r\n}\r\n\r\n/*******************************************************************************\r\n * Drag'n'drop support\r\n */\r\n\r\n/*** Helper object ************************************************************/\r\ndiv.dynatree-drag-helper\r\n{\r\n}\r\ndiv.dynatree-drag-helper a\r\n{\r\n\tborder: 1px solid gray;\r\n\tbackground-color: white;\r\n\tpadding-left: 5px;\r\n\tpadding-right: 5px;\r\n\topacity: 0.8;\r\n}\r\nspan.dynatree-drag-helper-img\r\n{\r\n\t/*\r\n\tposition: relative;\r\n\tleft: -16px;\r\n\t*/\r\n}\r\ndiv.dynatree-drag-helper /*.dynatree-drop-accept*/\r\n{\r\n\r\n/*    border-color: green;\r\n\tbackground-color: red;*/\r\n}\r\ndiv.dynatree-drop-accept span.dynatree-drag-helper-img\r\n{\r\n\tbackground-position: -32px -112px;\r\n}\r\ndiv.dynatree-drag-helper.dynatree-drop-reject\r\n{\r\n\tborder-color: red;\r\n}\r\ndiv.dynatree-drop-reject span.dynatree-drag-helper-img\r\n{\r\n\tbackground-position: -16px -112px;\r\n}\r\n\r\n/*** Drop marker icon *********************************************************/\r\n\r\n#dynatree-drop-marker\r\n{\r\n\twidth: 24px;\r\n\tposition: absolute;\r\n\tbackground-position: 0 -128px;\r\n}\r\n#dynatree-drop-marker.dynatree-drop-after,\r\n#dynatree-drop-marker.dynatree-drop-before\r\n{\r\n\twidth:64px;\r\n\tbackground-position: 0 -144px;\r\n}\r\n#dynatree-drop-marker.dynatree-drop-copy\r\n{\r\n\tbackground-position: -64px -128px;\r\n}\r\n#dynatree-drop-marker.dynatree-drop-move\r\n{\r\n\tbackground-position: -64px -128px;\r\n}\r\n\r\n/*** Source node while dragging ***********************************************/\r\n\r\nspan.dynatree-drag-source\r\n{\r\n\t/* border: 1px dotted gray; */\r\n\tbackground-color: #e0e0e0;\r\n}\r\nspan.dynatree-drag-source a\r\n{\r\n\tcolor: gray;\r\n}\r\n\r\n/*** Target node while dragging cursor is over it *****************************/\r\n\r\nspan.dynatree-drop-target\r\n{\r\n\t/*border: 1px solid gray;*/\r\n}\r\nspan.dynatree-drop-target a\r\n{\r\n\t/*background-repeat: no-repeat;\r\n\tbackground-position: right;\r\n\tbackground-image: url(\"/image/jquery.dynatree/drop_child.gif\");*/\r\n}\r\nspan.dynatree-drop-target.dynatree-drop-accept a\r\n{\r\n\t/*border: 1px solid green;*/\r\n\tbackground-color: #3169C6 !important;\r\n\tcolor: white !important; /* @ IE6 */\r\n\ttext-decoration: none;\r\n}\r\nspan.dynatree-drop-target.dynatree-drop-reject\r\n{\r\n\t/*border: 1px solid red;*/\r\n}\r\nspan.dynatree-drop-target.dynatree-drop-after a\r\n{\r\n\t/*background-repeat: repeat-x;\r\n\tbackground-position: bottom;\r\n\tbackground-image: url(\"/image/jquery.dynatree/drop_append.gif\");*/\r\n}\r\n\r\n\r\n/*******************************************************************************\r\n * Custom node classes (sample)\r\n */\r\n\r\nspan.custom1 a\r\n{\r\n\tbackground-color: maroon;\r\n\tcolor: yellow;\r\n}\r\n"
  },
  {
    "path": "public/index.graphtest.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>shib - Query your Hive!</title>\n<link type=\"text/css\" href=\"css/redmond/jquery-ui-1.8.13.custom.css\" rel=\"stylesheet\" />\t\n<script type=\"text/javascript\" src=\"js/jquery-1.5.1.min.js\"></script>\n<script type=\"text/javascript\" src=\"js/jquery-ui-1.8.13.custom.min.js\"></script>\n<script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"></script>\n<script type=\"text/javascript\" src=\"js/data1.js\"></script>\n<script type=\"text/javascript\" src=\"js/data2.js\"></script>\n<script type=\"text/javascript\" src=\"js/shib.graphtest.js\"></script>\n<script type=\"text/javascript\" src=\"js/shib.test_index.js\"></script>\n<link type=\"text/css\" href=\"css/shib.css\" rel=\"stylesheet\" />\n</head>\n<body>\n<h1>Welcome to jQuery UI!</h1>\n<p style=\"font-size: 1.3em; line-height: 1.5; margin: 1em 0; width: 50%;\">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 <a href=\"js/jquery-1.5.1.min.js\">jQuery</a>, your personalized copy of <a href=\"js/jquery-ui-1.8.13.custom.min.js\">jQuery UI (js/jquery-ui-1.8.13.custom.min.js)</a>, and <a href=\"css/redmond/jquery-ui-1.8.13.custom.css\">css/redmond/jquery-ui-1.8.13.custom.css</a> which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs. </p>\n<p style=\"font-size: 1.2em; line-height: 1.5; margin: 1em 0; width: 50%;\">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.</p>\t\n<p style=\"font-weight: bold; margin: 2em 0 1em; font-size: 1.3em;\">YOUR COMPONENTS:</p>\n\n<h3><a href=\"#\">グラフを描画</a></h3>\n<ul>\n  <li><div id=\"graph_render_execute_1\">data1</div></li>\n  <li><div id=\"graph_render_execute_2\">data2</div></li>\n</ul>\n<div id=\"chart_div\"></div>\n\n<h2 class=\"demoHeaders\">Tabs + Accordions</h2>\n\n<div id=\"ListSelector\">\n\n<ul>\n  <li><a href=\"#tab-keywords\">Keywords</a></li>\n  <li><a href=\"#tab-history\">History</a></li>\n</ul>\n\n<div id=\"tab-keywords\">\n\n<div>\n<h3><a href=\"#\">blog</a></h3>\n<div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n</div>\n</div>\n\n<div>\n<h3><a href=\"#\">blogimg</a></h3>\n<div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n</div>\n</div>\n\n<div>\n<h3><a href=\"#\">news</a></h3>\n<div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n<div>SELECT hoge, pos FROM access_log WHERE ...</div>\n</div>\n</div>\n</div>\n\n<div id=\"tab-history\">\n\n<div>\n<h3><a href=\"#\">2011/06</a></h3>\n<div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n</div>\n</div>\n\n<div>\n<h3><a href=\"#\">2011/05</a></h3>\n<div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n</div>\n</div>\n\n<div>\n<h3><a href=\"#\">2011/04</a></h3>\n<div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n<div>SELECT hhmm,count(hhmm) FROM parsed_log WHERE ...</div>\n</div>\n</div>\n</div>\n\n</div>\n\n\n\n<!-- Accordion -->\n<h2 class=\"demoHeaders\">Accordion</h2>\n<div id=\"accordion\">\n<div>\n<h3><a href=\"#\">First</a></h3>\n<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>\n</div>\n<div>\n<h3><a href=\"#\">Second</a></h3>\n<div>Phasellus mattis tincidunt nibh.</div>\n</div>\n<div>\n<h3><a href=\"#\">Third</a></h3>\n<div>Nam dui erat, auctor a, dignissim quis.</div>\n</div>\n</div>\n<!-- Tabs -->\n<h2 class=\"demoHeaders\">Tabs</h2>\n<div id=\"tabs\">\n<ul>\n  <li><a href=\"#tabs-1\">First</a></li>\n  <li><a href=\"#tabs-2\">Second</a></li>\n  <li><a href=\"#tabs-3\">Third</a></li>\n</ul>\n<div id=\"tabs-1\">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.</div>\n<div id=\"tabs-2\">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.</div>\n<div id=\"tabs-3\">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>\n</div>\n<!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->\n<h2 class=\"demoHeaders\">Dialog</h2>\n<p><a href=\"#\" id=\"dialog_link\" class=\"ui-state-default ui-corner-all\"><span class=\"ui-icon ui-icon-newwin\"></span>Open Dialog</a></p>\n\t\t\n<h2 class=\"demoHeaders\">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>\n<div style=\"position: relative; width: 96%; height: 200px; padding:1% 4%; overflow:hidden;\" class=\"fakewindowcontain\">\n<p>Lorem ipsum dolor sit amet,  Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>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. </p><p>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. </p><p>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. </p><p>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. </p><p>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. </p>\n\n<!-- ui-dialog -->\n<div class=\"ui-overlay\"><div class=\"ui-widget-overlay\"></div><div class=\"ui-widget-shadow ui-corner-all\" style=\"width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;\"></div></div>\n<div style=\"position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;\" class=\"ui-widget ui-widget-content ui-corner-all\">\n<div class=\"ui-dialog-content ui-widget-content\" style=\"background: none; border: 0;\">\n<p>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.</p>\n</div>\n</div>\n\n</div>\n\n\t\t\n\t\t<!-- ui-dialog -->\n\t\t<div id=\"dialog\" title=\"Dialog Title\">\n\t\t\t<p>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.</p>\n\t\t</div>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t<h2 class=\"demoHeaders\">Framework Icons (content color preview)</h2>\n\t\t<ul id=\"icons\" class=\"ui-widget ui-helper-clearfix\">\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-n\"><span class=\"ui-icon ui-icon-carat-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-ne\"><span class=\"ui-icon ui-icon-carat-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-e\"><span class=\"ui-icon ui-icon-carat-1-e\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-se\"><span class=\"ui-icon ui-icon-carat-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-s\"><span class=\"ui-icon ui-icon-carat-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-sw\"><span class=\"ui-icon ui-icon-carat-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-w\"><span class=\"ui-icon ui-icon-carat-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-nw\"><span class=\"ui-icon ui-icon-carat-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-2-n-s\"><span class=\"ui-icon ui-icon-carat-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-2-e-w\"><span class=\"ui-icon ui-icon-carat-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-n\"><span class=\"ui-icon ui-icon-triangle-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-ne\"><span class=\"ui-icon ui-icon-triangle-1-ne\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-e\"><span class=\"ui-icon ui-icon-triangle-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-se\"><span class=\"ui-icon ui-icon-triangle-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-s\"><span class=\"ui-icon ui-icon-triangle-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-sw\"><span class=\"ui-icon ui-icon-triangle-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-w\"><span class=\"ui-icon ui-icon-triangle-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-nw\"><span class=\"ui-icon ui-icon-triangle-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-2-n-s\"><span class=\"ui-icon ui-icon-triangle-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-2-e-w\"><span class=\"ui-icon ui-icon-triangle-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-n\"><span class=\"ui-icon ui-icon-arrow-1-n\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-ne\"><span class=\"ui-icon ui-icon-arrow-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-e\"><span class=\"ui-icon ui-icon-arrow-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-se\"><span class=\"ui-icon ui-icon-arrow-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-s\"><span class=\"ui-icon ui-icon-arrow-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-sw\"><span class=\"ui-icon ui-icon-arrow-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-w\"><span class=\"ui-icon ui-icon-arrow-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-nw\"><span class=\"ui-icon ui-icon-arrow-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-n-s\"><span class=\"ui-icon ui-icon-arrow-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-ne-sw\"><span class=\"ui-icon ui-icon-arrow-2-ne-sw\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-e-w\"><span class=\"ui-icon ui-icon-arrow-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-se-nw\"><span class=\"ui-icon ui-icon-arrow-2-se-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-n\"><span class=\"ui-icon ui-icon-arrowstop-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-e\"><span class=\"ui-icon ui-icon-arrowstop-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-s\"><span class=\"ui-icon ui-icon-arrowstop-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-w\"><span class=\"ui-icon ui-icon-arrowstop-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-n\"><span class=\"ui-icon ui-icon-arrowthick-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-ne\"><span class=\"ui-icon ui-icon-arrowthick-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-e\"><span class=\"ui-icon ui-icon-arrowthick-1-e\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-se\"><span class=\"ui-icon ui-icon-arrowthick-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-s\"><span class=\"ui-icon ui-icon-arrowthick-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-sw\"><span class=\"ui-icon ui-icon-arrowthick-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-w\"><span class=\"ui-icon ui-icon-arrowthick-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-nw\"><span class=\"ui-icon ui-icon-arrowthick-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-n-s\"><span class=\"ui-icon ui-icon-arrowthick-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-ne-sw\"><span class=\"ui-icon ui-icon-arrowthick-2-ne-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-e-w\"><span class=\"ui-icon ui-icon-arrowthick-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-se-nw\"><span class=\"ui-icon ui-icon-arrowthick-2-se-nw\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-n\"><span class=\"ui-icon ui-icon-arrowthickstop-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-e\"><span class=\"ui-icon ui-icon-arrowthickstop-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-s\"><span class=\"ui-icon ui-icon-arrowthickstop-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-w\"><span class=\"ui-icon ui-icon-arrowthickstop-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-w\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-n\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-e\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-s\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-w\"><span class=\"ui-icon ui-icon-arrowreturn-1-w\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-n\"><span class=\"ui-icon ui-icon-arrowreturn-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-e\"><span class=\"ui-icon ui-icon-arrowreturn-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-s\"><span class=\"ui-icon ui-icon-arrowreturn-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-w\"><span class=\"ui-icon ui-icon-arrowrefresh-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-n\"><span class=\"ui-icon ui-icon-arrowrefresh-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-e\"><span class=\"ui-icon ui-icon-arrowrefresh-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-s\"><span class=\"ui-icon ui-icon-arrowrefresh-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-4\"><span class=\"ui-icon ui-icon-arrow-4\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-4-diag\"><span class=\"ui-icon ui-icon-arrow-4-diag\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-extlink\"><span class=\"ui-icon ui-icon-extlink\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-newwin\"><span class=\"ui-icon ui-icon-newwin\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-refresh\"><span class=\"ui-icon ui-icon-refresh\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-shuffle\"><span class=\"ui-icon ui-icon-shuffle\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-transfer-e-w\"><span class=\"ui-icon ui-icon-transfer-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-transferthick-e-w\"><span class=\"ui-icon ui-icon-transferthick-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-folder-collapsed\"><span class=\"ui-icon ui-icon-folder-collapsed\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-folder-open\"><span class=\"ui-icon ui-icon-folder-open\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-document\"><span class=\"ui-icon ui-icon-document\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-document-b\"><span class=\"ui-icon ui-icon-document-b\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-note\"><span class=\"ui-icon ui-icon-note\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-mail-closed\"><span class=\"ui-icon ui-icon-mail-closed\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-mail-open\"><span class=\"ui-icon ui-icon-mail-open\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-suitcase\"><span class=\"ui-icon ui-icon-suitcase\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-comment\"><span class=\"ui-icon ui-icon-comment\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-person\"><span class=\"ui-icon ui-icon-person\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-print\"><span class=\"ui-icon ui-icon-print\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-trash\"><span class=\"ui-icon ui-icon-trash\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-locked\"><span class=\"ui-icon ui-icon-locked\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-unlocked\"><span class=\"ui-icon ui-icon-unlocked\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-bookmark\"><span class=\"ui-icon ui-icon-bookmark\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-tag\"><span class=\"ui-icon ui-icon-tag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-home\"><span class=\"ui-icon ui-icon-home\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-flag\"><span class=\"ui-icon ui-icon-flag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-calculator\"><span class=\"ui-icon ui-icon-calculator\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-cart\"><span class=\"ui-icon ui-icon-cart\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pencil\"><span class=\"ui-icon ui-icon-pencil\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-clock\"><span class=\"ui-icon ui-icon-clock\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-disk\"><span class=\"ui-icon ui-icon-disk\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-calendar\"><span class=\"ui-icon ui-icon-calendar\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-zoomin\"><span class=\"ui-icon ui-icon-zoomin\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-zoomout\"><span class=\"ui-icon ui-icon-zoomout\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-search\"><span class=\"ui-icon ui-icon-search\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-wrench\"><span class=\"ui-icon ui-icon-wrench\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-gear\"><span class=\"ui-icon ui-icon-gear\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-heart\"><span class=\"ui-icon ui-icon-heart\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-star\"><span class=\"ui-icon ui-icon-star\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-link\"><span class=\"ui-icon ui-icon-link\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-cancel\"><span class=\"ui-icon ui-icon-cancel\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-plus\"><span class=\"ui-icon ui-icon-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-plusthick\"><span class=\"ui-icon ui-icon-plusthick\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-minus\"><span class=\"ui-icon ui-icon-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-minusthick\"><span class=\"ui-icon ui-icon-minusthick\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-close\"><span class=\"ui-icon ui-icon-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-closethick\"><span class=\"ui-icon ui-icon-closethick\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-key\"><span class=\"ui-icon ui-icon-key\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-lightbulb\"><span class=\"ui-icon ui-icon-lightbulb\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-scissors\"><span class=\"ui-icon ui-icon-scissors\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-clipboard\"><span class=\"ui-icon ui-icon-clipboard\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-copy\"><span class=\"ui-icon ui-icon-copy\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-contact\"><span class=\"ui-icon ui-icon-contact\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-image\"><span class=\"ui-icon ui-icon-image\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-video\"><span class=\"ui-icon ui-icon-video\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-script\"><span class=\"ui-icon ui-icon-script\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-alert\"><span class=\"ui-icon ui-icon-alert\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-info\"><span class=\"ui-icon ui-icon-info\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-notice\"><span class=\"ui-icon ui-icon-notice\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-help\"><span class=\"ui-icon ui-icon-help\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-check\"><span class=\"ui-icon ui-icon-check\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-bullet\"><span class=\"ui-icon ui-icon-bullet\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-radio-off\"><span class=\"ui-icon ui-icon-radio-off\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-radio-on\"><span class=\"ui-icon ui-icon-radio-on\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pin-w\"><span class=\"ui-icon ui-icon-pin-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pin-s\"><span class=\"ui-icon ui-icon-pin-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-play\"><span class=\"ui-icon ui-icon-play\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pause\"><span class=\"ui-icon ui-icon-pause\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-next\"><span class=\"ui-icon ui-icon-seek-next\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-prev\"><span class=\"ui-icon ui-icon-seek-prev\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-end\"><span class=\"ui-icon ui-icon-seek-end\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-first\"><span class=\"ui-icon ui-icon-seek-first\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-stop\"><span class=\"ui-icon ui-icon-stop\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-eject\"><span class=\"ui-icon ui-icon-eject\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-volume-off\"><span class=\"ui-icon ui-icon-volume-off\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-volume-on\"><span class=\"ui-icon ui-icon-volume-on\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-power\"><span class=\"ui-icon ui-icon-power\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-signal-diag\"><span class=\"ui-icon ui-icon-signal-diag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-signal\"><span class=\"ui-icon ui-icon-signal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-0\"><span class=\"ui-icon ui-icon-battery-0\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-1\"><span class=\"ui-icon ui-icon-battery-1\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-2\"><span class=\"ui-icon ui-icon-battery-2\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-3\"><span class=\"ui-icon ui-icon-battery-3\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-plus\"><span class=\"ui-icon ui-icon-circle-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-minus\"><span class=\"ui-icon ui-icon-circle-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-close\"><span class=\"ui-icon ui-icon-circle-close\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-e\"><span class=\"ui-icon ui-icon-circle-triangle-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-s\"><span class=\"ui-icon ui-icon-circle-triangle-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-w\"><span class=\"ui-icon ui-icon-circle-triangle-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-n\"><span class=\"ui-icon ui-icon-circle-triangle-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-e\"><span class=\"ui-icon ui-icon-circle-arrow-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-s\"><span class=\"ui-icon ui-icon-circle-arrow-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-w\"><span class=\"ui-icon ui-icon-circle-arrow-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-n\"><span class=\"ui-icon ui-icon-circle-arrow-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-zoomin\"><span class=\"ui-icon ui-icon-circle-zoomin\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-zoomout\"><span class=\"ui-icon ui-icon-circle-zoomout\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-check\"><span class=\"ui-icon ui-icon-circle-check\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-plus\"><span class=\"ui-icon ui-icon-circlesmall-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-minus\"><span class=\"ui-icon ui-icon-circlesmall-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-close\"><span class=\"ui-icon ui-icon-circlesmall-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-plus\"><span class=\"ui-icon ui-icon-squaresmall-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-minus\"><span class=\"ui-icon ui-icon-squaresmall-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-close\"><span class=\"ui-icon ui-icon-squaresmall-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-dotted-vertical\"><span class=\"ui-icon ui-icon-grip-dotted-vertical\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-dotted-horizontal\"><span class=\"ui-icon ui-icon-grip-dotted-horizontal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-solid-vertical\"><span class=\"ui-icon ui-icon-grip-solid-vertical\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-solid-horizontal\"><span class=\"ui-icon ui-icon-grip-solid-horizontal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-gripsmall-diagonal-se\"><span class=\"ui-icon ui-icon-gripsmall-diagonal-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-diagonal-se\"><span class=\"ui-icon ui-icon-grip-diagonal-se\"></span></li>\n\t\t</ul>\n\n\t\n\t\t<!-- Slider -->\n\t\t<h2 class=\"demoHeaders\">Slider</h2>\n\t\t<div id=\"slider\"></div>\n\t\n\t\t<!-- Datepicker -->\n\t\t<h2 class=\"demoHeaders\">Datepicker</h2>\n\t\t<div id=\"datepicker\"></div>\n\t\n\t\t<!-- Progressbar -->\n\t\t<h2 class=\"demoHeaders\">Progressbar</h2>\t\n\t\t<div id=\"progressbar\"></div>\n\t\t\t\n\t\t<!-- Highlight / Error -->\n\t\t<h2 class=\"demoHeaders\">Highlight / Error</h2>\n\t\t<div class=\"ui-widget\">\n\t\t\t<div class=\"ui-state-highlight ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\"> \n\t\t\t\t<p><span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: .3em;\"></span>\n\t\t\t\t<strong>Hey!</strong> Sample ui-state-highlight style.</p>\n\t\t\t</div>\n\t\t</div>\n\t\t<br/>\n\t\t<div class=\"ui-widget\">\n\t\t\t<div class=\"ui-state-error ui-corner-all\" style=\"padding: 0 .7em;\"> \n\t\t\t\t<p><span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span> \n\t\t\t\t<strong>Alert:</strong> Sample ui-state-error style.</p>\n\t\t\t</div>\n\t\t</div>\n\n\t</body>\n</html>\n\n\n"
  },
  {
    "path": "public/index.jquery-ui-default.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>jQuery UI Example Page</title>\n<link type=\"text/css\" href=\"css/redmond/jquery-ui-1.8.13.custom.css\" rel=\"stylesheet\" />\t\n<script type=\"text/javascript\" src=\"js/jquery-1.5.1.min.js\"></script>\n<script type=\"text/javascript\" src=\"js/jquery-ui-1.8.13.custom.min.js\"></script>\n<script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"></script>\n<script type=\"text/javascript\" src=\"js/data1.js\"></script>\n<script type=\"text/javascript\" src=\"js/shib.graphtest.js\"></script>\n<script type=\"text/javascript\">\n$(function(){\n  // Accordion\n  $(\"#accordion\").accordion({ header: \"h3\" });\n\n  // Tabs\n  $('#tabs').tabs();\n\n  // Dialog\t\t\t\n  $('#dialog').dialog({\n    autoOpen: false,\n    width: 600,\n    buttons: {\n      \"Ok\": function() { \n        $(this).dialog(\"close\"); \n      }, \n      \"Cancel\": function() { \n        $(this).dialog(\"close\"); \n      } \n    }\n  });\n\n  // Dialog Link\n  $('#dialog_link').click(function(){\n    $('#dialog').dialog('open');\n    return false;\n  });\n\n  // Datepicker\n  $('#datepicker').datepicker({\n    inline: true\n  });\n\n  // Slider\n  $('#slider').slider({\n    range: true,\n    values: [17, 67]\n  });\n\n  // Progressbar\n  $(\"#progressbar\").progressbar({\n    value: 20 \n  });\n\n  //hover states on the static widgets\n  $('#dialog_link, ul#icons li').hover(\n    function() { $(this).addClass('ui-state-hover'); }, \n    function() { $(this).removeClass('ui-state-hover'); }\n  );\n});\n</script>\n<style type=\"text/css\">\n/*demo page css*/\nbody{ font: 62.5% \"Trebuchet MS\", sans-serif; margin: 50px;}\n.demoHeaders { margin-top: 2em; }\n#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}\n#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}\nul#icons {margin: 0; padding: 0;}\nul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}\nul#icons span.ui-icon {float: left; margin: 0 4px;}\n</style>\t\n</head>\n<body>\n<h1>Welcome to jQuery UI!</h1>\n<p style=\"font-size: 1.3em; line-height: 1.5; margin: 1em 0; width: 50%;\">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 <a href=\"js/jquery-1.5.1.min.js\">jQuery</a>, your personalized copy of <a href=\"js/jquery-ui-1.8.13.custom.min.js\">jQuery UI (js/jquery-ui-1.8.13.custom.min.js)</a>, and <a href=\"css/redmond/jquery-ui-1.8.13.custom.css\">css/redmond/jquery-ui-1.8.13.custom.css</a> which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs. </p>\n<p style=\"font-size: 1.2em; line-height: 1.5; margin: 1em 0; width: 50%;\">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.</p>\t\n<p style=\"font-weight: bold; margin: 2em 0 1em; font-size: 1.3em;\">YOUR COMPONENTS:</p>\n<!-- Accordion -->\n<h2 class=\"demoHeaders\">Accordion</h2>\n<div id=\"accordion\">\n<div>\n<h3><a href=\"#\">First</a></h3>\n<div>Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.</div>\n</div>\n<div>\n<h3><a href=\"#\">Second</a></h3>\n<div>Phasellus mattis tincidunt nibh.</div>\n</div>\n<div>\n<h3><a href=\"#\">Third</a></h3>\n<div>Nam dui erat, auctor a, dignissim quis.</div>\n</div>\n</div>\n<!-- Tabs -->\n<h2 class=\"demoHeaders\">Tabs</h2>\n<div id=\"tabs\">\n<ul>\n  <li><a href=\"#tabs-1\">First</a></li>\n  <li><a href=\"#tabs-2\">Second</a></li>\n  <li><a href=\"#tabs-3\">Third</a></li>\n</ul>\n<div id=\"tabs-1\">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.</div>\n<div id=\"tabs-2\">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.</div>\n<div id=\"tabs-3\">Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</div>\n</div>\n<!-- Dialog NOTE: Dialog is not generated by UI in this demo so it can be visually styled in themeroller-->\n<h2 class=\"demoHeaders\">Dialog</h2>\n<p><a href=\"#\" id=\"dialog_link\" class=\"ui-state-default ui-corner-all\"><span class=\"ui-icon ui-icon-newwin\"></span>Open Dialog</a></p>\n\t\t\n<h2 class=\"demoHeaders\">Overlay and Shadow Classes <em>(not currently used in UI widgets)</em></h2>\n<div style=\"position: relative; width: 96%; height: 200px; padding:1% 4%; overflow:hidden;\" class=\"fakewindowcontain\">\n<p>Lorem ipsum dolor sit amet,  Nulla nec tortor. Donec id elit quis purus consectetur consequat. </p><p>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. </p><p>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. </p><p>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. </p><p>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. </p><p>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. </p>\n\n<!-- ui-dialog -->\n<div class=\"ui-overlay\"><div class=\"ui-widget-overlay\"></div><div class=\"ui-widget-shadow ui-corner-all\" style=\"width: 302px; height: 152px; position: absolute; left: 50px; top: 30px;\"></div></div>\n<div style=\"position: absolute; width: 280px; height: 130px;left: 50px; top: 30px; padding: 10px;\" class=\"ui-widget ui-widget-content ui-corner-all\">\n<div class=\"ui-dialog-content ui-widget-content\" style=\"background: none; border: 0;\">\n<p>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.</p>\n</div>\n</div>\n\n</div>\n\n\t\t\n\t\t<!-- ui-dialog -->\n\t\t<div id=\"dialog\" title=\"Dialog Title\">\n\t\t\t<p>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.</p>\n\t\t</div>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t<h2 class=\"demoHeaders\">Framework Icons (content color preview)</h2>\n\t\t<ul id=\"icons\" class=\"ui-widget ui-helper-clearfix\">\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-n\"><span class=\"ui-icon ui-icon-carat-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-ne\"><span class=\"ui-icon ui-icon-carat-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-e\"><span class=\"ui-icon ui-icon-carat-1-e\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-se\"><span class=\"ui-icon ui-icon-carat-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-s\"><span class=\"ui-icon ui-icon-carat-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-sw\"><span class=\"ui-icon ui-icon-carat-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-w\"><span class=\"ui-icon ui-icon-carat-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-1-nw\"><span class=\"ui-icon ui-icon-carat-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-2-n-s\"><span class=\"ui-icon ui-icon-carat-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-carat-2-e-w\"><span class=\"ui-icon ui-icon-carat-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-n\"><span class=\"ui-icon ui-icon-triangle-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-ne\"><span class=\"ui-icon ui-icon-triangle-1-ne\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-e\"><span class=\"ui-icon ui-icon-triangle-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-se\"><span class=\"ui-icon ui-icon-triangle-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-s\"><span class=\"ui-icon ui-icon-triangle-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-sw\"><span class=\"ui-icon ui-icon-triangle-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-w\"><span class=\"ui-icon ui-icon-triangle-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-1-nw\"><span class=\"ui-icon ui-icon-triangle-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-2-n-s\"><span class=\"ui-icon ui-icon-triangle-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-triangle-2-e-w\"><span class=\"ui-icon ui-icon-triangle-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-n\"><span class=\"ui-icon ui-icon-arrow-1-n\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-ne\"><span class=\"ui-icon ui-icon-arrow-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-e\"><span class=\"ui-icon ui-icon-arrow-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-se\"><span class=\"ui-icon ui-icon-arrow-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-s\"><span class=\"ui-icon ui-icon-arrow-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-sw\"><span class=\"ui-icon ui-icon-arrow-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-w\"><span class=\"ui-icon ui-icon-arrow-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-1-nw\"><span class=\"ui-icon ui-icon-arrow-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-n-s\"><span class=\"ui-icon ui-icon-arrow-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-ne-sw\"><span class=\"ui-icon ui-icon-arrow-2-ne-sw\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-e-w\"><span class=\"ui-icon ui-icon-arrow-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-2-se-nw\"><span class=\"ui-icon ui-icon-arrow-2-se-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-n\"><span class=\"ui-icon ui-icon-arrowstop-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-e\"><span class=\"ui-icon ui-icon-arrowstop-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-s\"><span class=\"ui-icon ui-icon-arrowstop-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowstop-1-w\"><span class=\"ui-icon ui-icon-arrowstop-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-n\"><span class=\"ui-icon ui-icon-arrowthick-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-ne\"><span class=\"ui-icon ui-icon-arrowthick-1-ne\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-e\"><span class=\"ui-icon ui-icon-arrowthick-1-e\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-se\"><span class=\"ui-icon ui-icon-arrowthick-1-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-s\"><span class=\"ui-icon ui-icon-arrowthick-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-sw\"><span class=\"ui-icon ui-icon-arrowthick-1-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-w\"><span class=\"ui-icon ui-icon-arrowthick-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-1-nw\"><span class=\"ui-icon ui-icon-arrowthick-1-nw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-n-s\"><span class=\"ui-icon ui-icon-arrowthick-2-n-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-ne-sw\"><span class=\"ui-icon ui-icon-arrowthick-2-ne-sw\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-e-w\"><span class=\"ui-icon ui-icon-arrowthick-2-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthick-2-se-nw\"><span class=\"ui-icon ui-icon-arrowthick-2-se-nw\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-n\"><span class=\"ui-icon ui-icon-arrowthickstop-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-e\"><span class=\"ui-icon ui-icon-arrowthickstop-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-s\"><span class=\"ui-icon ui-icon-arrowthickstop-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowthickstop-1-w\"><span class=\"ui-icon ui-icon-arrowthickstop-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-w\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-n\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-e\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturnthick-1-s\"><span class=\"ui-icon ui-icon-arrowreturnthick-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-w\"><span class=\"ui-icon ui-icon-arrowreturn-1-w\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-n\"><span class=\"ui-icon ui-icon-arrowreturn-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-e\"><span class=\"ui-icon ui-icon-arrowreturn-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowreturn-1-s\"><span class=\"ui-icon ui-icon-arrowreturn-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-w\"><span class=\"ui-icon ui-icon-arrowrefresh-1-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-n\"><span class=\"ui-icon ui-icon-arrowrefresh-1-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-e\"><span class=\"ui-icon ui-icon-arrowrefresh-1-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrowrefresh-1-s\"><span class=\"ui-icon ui-icon-arrowrefresh-1-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-4\"><span class=\"ui-icon ui-icon-arrow-4\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-arrow-4-diag\"><span class=\"ui-icon ui-icon-arrow-4-diag\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-extlink\"><span class=\"ui-icon ui-icon-extlink\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-newwin\"><span class=\"ui-icon ui-icon-newwin\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-refresh\"><span class=\"ui-icon ui-icon-refresh\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-shuffle\"><span class=\"ui-icon ui-icon-shuffle\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-transfer-e-w\"><span class=\"ui-icon ui-icon-transfer-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-transferthick-e-w\"><span class=\"ui-icon ui-icon-transferthick-e-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-folder-collapsed\"><span class=\"ui-icon ui-icon-folder-collapsed\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-folder-open\"><span class=\"ui-icon ui-icon-folder-open\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-document\"><span class=\"ui-icon ui-icon-document\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-document-b\"><span class=\"ui-icon ui-icon-document-b\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-note\"><span class=\"ui-icon ui-icon-note\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-mail-closed\"><span class=\"ui-icon ui-icon-mail-closed\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-mail-open\"><span class=\"ui-icon ui-icon-mail-open\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-suitcase\"><span class=\"ui-icon ui-icon-suitcase\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-comment\"><span class=\"ui-icon ui-icon-comment\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-person\"><span class=\"ui-icon ui-icon-person\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-print\"><span class=\"ui-icon ui-icon-print\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-trash\"><span class=\"ui-icon ui-icon-trash\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-locked\"><span class=\"ui-icon ui-icon-locked\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-unlocked\"><span class=\"ui-icon ui-icon-unlocked\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-bookmark\"><span class=\"ui-icon ui-icon-bookmark\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-tag\"><span class=\"ui-icon ui-icon-tag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-home\"><span class=\"ui-icon ui-icon-home\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-flag\"><span class=\"ui-icon ui-icon-flag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-calculator\"><span class=\"ui-icon ui-icon-calculator\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-cart\"><span class=\"ui-icon ui-icon-cart\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pencil\"><span class=\"ui-icon ui-icon-pencil\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-clock\"><span class=\"ui-icon ui-icon-clock\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-disk\"><span class=\"ui-icon ui-icon-disk\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-calendar\"><span class=\"ui-icon ui-icon-calendar\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-zoomin\"><span class=\"ui-icon ui-icon-zoomin\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-zoomout\"><span class=\"ui-icon ui-icon-zoomout\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-search\"><span class=\"ui-icon ui-icon-search\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-wrench\"><span class=\"ui-icon ui-icon-wrench\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-gear\"><span class=\"ui-icon ui-icon-gear\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-heart\"><span class=\"ui-icon ui-icon-heart\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-star\"><span class=\"ui-icon ui-icon-star\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-link\"><span class=\"ui-icon ui-icon-link\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-cancel\"><span class=\"ui-icon ui-icon-cancel\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-plus\"><span class=\"ui-icon ui-icon-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-plusthick\"><span class=\"ui-icon ui-icon-plusthick\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-minus\"><span class=\"ui-icon ui-icon-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-minusthick\"><span class=\"ui-icon ui-icon-minusthick\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-close\"><span class=\"ui-icon ui-icon-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-closethick\"><span class=\"ui-icon ui-icon-closethick\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-key\"><span class=\"ui-icon ui-icon-key\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-lightbulb\"><span class=\"ui-icon ui-icon-lightbulb\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-scissors\"><span class=\"ui-icon ui-icon-scissors\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-clipboard\"><span class=\"ui-icon ui-icon-clipboard\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-copy\"><span class=\"ui-icon ui-icon-copy\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-contact\"><span class=\"ui-icon ui-icon-contact\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-image\"><span class=\"ui-icon ui-icon-image\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-video\"><span class=\"ui-icon ui-icon-video\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-script\"><span class=\"ui-icon ui-icon-script\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-alert\"><span class=\"ui-icon ui-icon-alert\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-info\"><span class=\"ui-icon ui-icon-info\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-notice\"><span class=\"ui-icon ui-icon-notice\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-help\"><span class=\"ui-icon ui-icon-help\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-check\"><span class=\"ui-icon ui-icon-check\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-bullet\"><span class=\"ui-icon ui-icon-bullet\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-radio-off\"><span class=\"ui-icon ui-icon-radio-off\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-radio-on\"><span class=\"ui-icon ui-icon-radio-on\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pin-w\"><span class=\"ui-icon ui-icon-pin-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pin-s\"><span class=\"ui-icon ui-icon-pin-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-play\"><span class=\"ui-icon ui-icon-play\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-pause\"><span class=\"ui-icon ui-icon-pause\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-next\"><span class=\"ui-icon ui-icon-seek-next\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-prev\"><span class=\"ui-icon ui-icon-seek-prev\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-end\"><span class=\"ui-icon ui-icon-seek-end\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-seek-first\"><span class=\"ui-icon ui-icon-seek-first\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-stop\"><span class=\"ui-icon ui-icon-stop\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-eject\"><span class=\"ui-icon ui-icon-eject\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-volume-off\"><span class=\"ui-icon ui-icon-volume-off\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-volume-on\"><span class=\"ui-icon ui-icon-volume-on\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-power\"><span class=\"ui-icon ui-icon-power\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-signal-diag\"><span class=\"ui-icon ui-icon-signal-diag\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-signal\"><span class=\"ui-icon ui-icon-signal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-0\"><span class=\"ui-icon ui-icon-battery-0\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-1\"><span class=\"ui-icon ui-icon-battery-1\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-2\"><span class=\"ui-icon ui-icon-battery-2\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-battery-3\"><span class=\"ui-icon ui-icon-battery-3\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-plus\"><span class=\"ui-icon ui-icon-circle-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-minus\"><span class=\"ui-icon ui-icon-circle-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-close\"><span class=\"ui-icon ui-icon-circle-close\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-e\"><span class=\"ui-icon ui-icon-circle-triangle-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-s\"><span class=\"ui-icon ui-icon-circle-triangle-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-w\"><span class=\"ui-icon ui-icon-circle-triangle-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-triangle-n\"><span class=\"ui-icon ui-icon-circle-triangle-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-e\"><span class=\"ui-icon ui-icon-circle-arrow-e\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-s\"><span class=\"ui-icon ui-icon-circle-arrow-s\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-w\"><span class=\"ui-icon ui-icon-circle-arrow-w\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-arrow-n\"><span class=\"ui-icon ui-icon-circle-arrow-n\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-zoomin\"><span class=\"ui-icon ui-icon-circle-zoomin\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-zoomout\"><span class=\"ui-icon ui-icon-circle-zoomout\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circle-check\"><span class=\"ui-icon ui-icon-circle-check\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-plus\"><span class=\"ui-icon ui-icon-circlesmall-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-minus\"><span class=\"ui-icon ui-icon-circlesmall-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-circlesmall-close\"><span class=\"ui-icon ui-icon-circlesmall-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-plus\"><span class=\"ui-icon ui-icon-squaresmall-plus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-minus\"><span class=\"ui-icon ui-icon-squaresmall-minus\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-squaresmall-close\"><span class=\"ui-icon ui-icon-squaresmall-close\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-dotted-vertical\"><span class=\"ui-icon ui-icon-grip-dotted-vertical\"></span></li>\n\t\t\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-dotted-horizontal\"><span class=\"ui-icon ui-icon-grip-dotted-horizontal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-solid-vertical\"><span class=\"ui-icon ui-icon-grip-solid-vertical\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-solid-horizontal\"><span class=\"ui-icon ui-icon-grip-solid-horizontal\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-gripsmall-diagonal-se\"><span class=\"ui-icon ui-icon-gripsmall-diagonal-se\"></span></li>\n\t\t<li class=\"ui-state-default ui-corner-all\" title=\".ui-icon-grip-diagonal-se\"><span class=\"ui-icon ui-icon-grip-diagonal-se\"></span></li>\n\t\t</ul>\n\n\t\n\t\t<!-- Slider -->\n\t\t<h2 class=\"demoHeaders\">Slider</h2>\n\t\t<div id=\"slider\"></div>\n\t\n\t\t<!-- Datepicker -->\n\t\t<h2 class=\"demoHeaders\">Datepicker</h2>\n\t\t<div id=\"datepicker\"></div>\n\t\n\t\t<!-- Progressbar -->\n\t\t<h2 class=\"demoHeaders\">Progressbar</h2>\t\n\t\t<div id=\"progressbar\"></div>\n\t\t\t\n\t\t<!-- Highlight / Error -->\n\t\t<h2 class=\"demoHeaders\">Highlight / Error</h2>\n\t\t<div class=\"ui-widget\">\n\t\t\t<div class=\"ui-state-highlight ui-corner-all\" style=\"margin-top: 20px; padding: 0 .7em;\"> \n\t\t\t\t<p><span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: .3em;\"></span>\n\t\t\t\t<strong>Hey!</strong> Sample ui-state-highlight style.</p>\n\t\t\t</div>\n\t\t</div>\n\t\t<br/>\n\t\t<div class=\"ui-widget\">\n\t\t\t<div class=\"ui-state-error ui-corner-all\" style=\"padding: 0 .7em;\"> \n\t\t\t\t<p><span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span> \n\t\t\t\t<strong>Alert:</strong> Sample ui-state-error style.</p>\n\t\t\t</div>\n\t\t</div>\n\n\t</body>\n</html>\n\n\n"
  },
  {
    "path": "public/js/shib.js",
    "content": "var shibnotifications = [];\nvar shibdata = {};\nvar shibselectedquery = null;\nvar shibselectedquery_dom = null;\n\nvar shib_QUERY_STATUS_CHECK_INTERVAL = 5000;\nvar shib_QUERY_EDITOR_WATCHER_INTERVAL = 500;\nvar shib_NOTIFICATION_CHECK_INTERVAL = 100;\nvar shib_NOTIFICATION_DEFAULT_DURATION_SECONDS = 10;\nvar shib_RUNNING_QUERY_UPDATE_INTERVAL = 15000;\nvar shib_RUNNING_QUERY_LOAD_INITIALY = 2000;\n\nvar engineInfo = null;\nvar authInfo = null;\nvar authEnabled = false;\n\nfunction authAjax(req){\n  if (authInfo)\n    req['headers'] = { 'X-Shib-AuthInfo': authInfo };\n  $.ajax(req);\n}\n\nfunction authGet(url, callback){\n  authAjax({url: url, success: callback});\n}\n\nfunction authGetJSON(url, callback){\n  authAjax({url: url, success: callback, dataType: \"json\"});\n}\n\nfunction authGetText(url, callback){\n  authAjax({url: url, success: callback, dataType: \"text\"});\n}\n\n$(function(){\n  check_auth_initial();\n\n  load_tabs({callback:function(){\n    follow_current_uri();\n    setInterval(check_selected_running_query_state, shib_QUERY_STATUS_CHECK_INTERVAL);\n    setInterval(show_notification, shib_NOTIFICATION_CHECK_INTERVAL);\n    setInterval(update_running_queries, shib_RUNNING_QUERY_UPDATE_INTERVAL);\n    setTimeout(update_running_queries, shib_RUNNING_QUERY_LOAD_INITIALY);\n  }});\n  \n  //hover states on the static widgets\n  $('ul.operationitems li').hover(\n    function() { $(this).addClass('ui-state-hover'); }, \n    function() { $(this).removeClass('ui-state-hover'); }\n  );\n\n  $('#tables_diag,#describe_diag')\n      .css('text-decoration', 'line-through')\n      .css('cursor', 'wait');\n  load_pairs(function(){\n    $('#tables_diag').click(function(event){show_tables_dialog();});\n    $('#table_pairs').change(function(event){show_tables_dialog();});\n    $('#describe_diag').click(function(event){show_describe_dialog();});\n    $('#desc_pairs').change(function(event){show_describe_dialog();});\n    $('#taglist_diag').click(function(event){show_taglist_dialog();});\n    $('#tables_diag,#describe_diag,#taglist_diag')\n        .css('text-decoration', '')\n        .css('cursor', 'pointer');\n  });\n\n  $('#new_button').click(initiate_mainview);\n  $('#copy_button').click(copy_selected_query);\n  $('#clip_button').click(clip_selected_query);\n  $('#unclip_button').click(unclip_selected_query);\n\n  $('#auth_button').click(show_auth_dialog);\n  $('#execute_button').click(execute_query);\n  $('#giveup_button').click(giveup_query);\n  $('#status_button').click(show_status_query);\n  $('#delete_button').click(delete_query);\n  $('#display_full_button').click(function(){show_result_query({range:'full'});});\n  $('#display_head_button').click(function(){show_result_query({range:'head'});});\n  $('#download_tsv_button').click(function(){download_result_query({format:'tsv'});});\n  $('#download_csv_button').click(function(){download_result_query({format:'csv'});});\n\n  $('#edit_tag_button').click(show_edit_tag_dialog);\n  $('#add_tag_submit').click(execute_add_tag);\n  $('#remove_tag_submit').click(execute_remove_tag);\n  $('#auth_submit').click(check_auth);\n});\n\n/* engine/database pairs list loading (just after page loading) */\n\n$.template(\"pairTemplate\",\n           '<option data-engine=\"${Engine}\" data-database=\"${Dbname}\" value=\"${Engine}/${Dbname}\">${Engine} - ${Dbname}</option>');\nfunction load_pairs(callback) {\n  authGet('/engines?=' + (new Date()).getTime(), function(data){\n    engineInfo = data;\n\n    $('select#table_pairs,select#desc_pairs,select#exec_pairs').empty();\n    $.tmpl('pairTemplate',\n        engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })\n    ).appendTo('select#table_pairs');\n    $.tmpl('pairTemplate',\n        engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })\n    ).appendTo('select#desc_pairs');\n    $.tmpl('pairTemplate',\n        engineInfo.pairs.map(function(pair){ return { Engine:pair[0], Dbname:pair[1] }; })\n    ).appendTo('select#exec_pairs');\n    if (callback)\n      callback();\n  });\n};\n\n/* authentication check initially */\n\nfunction check_auth_initial() {\n  authAjax({\n    type: \"POST\",\n    url: '/auth',\n    data: {},\n    cache: false,\n    success: function(data){\n      authInfo = data.authInfo;\n      authEnabled = data.enabled;\n      // show execute button instead of auth button\n      if ($('#auth_button:visible').size() > 0)\n        show_editbox_buttons(['execute_button']);\n      $('span#authRealm').text(data.realm);\n    },\n    error: function(jqXHR, textStatus, errorThrown){\n      authInfo = null;\n      var data = JSON.parse(jqXHR.responseText);\n      authEnabled = data.enabled;\n      $('span#authRealm').text(data.realm);\n    }\n  });\n}\n\n/* basic data operations */\n\nfunction set_execute_query_list(list) {\n  if (! window.localStorage) return;\n  window.localStorage.executeList = JSON.stringify(list);\n};\n\nfunction delete_execute_query_item(queryid) {\n  if (! window.localStorage) return;\n  window.localStorage.executeList = JSON.stringify(execute_query_list().filter(function(v){return v !== queryid;}));\n};\n\nfunction execute_query_list() {\n  if (! window.localStorage) return [];\n  var list = [];\n  try {\n    var listString = window.localStorage.executeList;\n    if (listString && listString.length > 0)\n      list = JSON.parse(listString);\n  } catch (e) { set_execute_query_list([]); list = []; }\n  return list;\n};\n\nfunction push_execute_query_list(queryid, refresh) {\n  if (! window.localStorage) return;\n  var list = execute_query_list();\n  if (refresh)\n    list = list.filter(function(v){return v !== queryid;});\n  else if (list.filter(function(v){return v === queryid;}).length > 0)\n    return;\n  if (list.length > 10) list = list.slice(0,10);\n  list.unshift(queryid);\n  set_execute_query_list(list);\n};\n\nfunction set_bookmark_query_list(list) {\n  if (! window.localStorage) return;\n  window.localStorage.bookmark = JSON.stringify(list);\n};\n\nfunction delete_bookmark_query_list(queryid) {\n  if (! window.localStorage) return;\n  window.localStorage.bookmark = JSON.stringify(bookmark_query_list().filter(function(v){return v !== queryid;}));\n};\n\nfunction bookmark_query_list() {\n  if (! window.localStorage) return [];\n  var list = [];\n  try {\n    var listString = window.localStorage.bookmark;\n    if (listString && listString.length > 0)\n      list = JSON.parse(listString);\n  } catch (e) { set_bookmark_query_list([]); list = []; }\n  return list;\n};\n\nfunction exists_in_bookmark_query_list(queryid) {\n  if (! window.localStorage) return false;\n  return bookmark_query_list().filter(function(v){return v === queryid;}).length > 0;\n};\n\nfunction push_bookmark_query_list(queryid) {\n  if (! window.localStorage) return;\n  var list = bookmark_query_list().filter(function(v){return v !== queryid;});\n  list.unshift(queryid);\n  set_bookmark_query_list(list);\n};\n\nfunction query_last_result(query) {\n  var obj = null;\n  if (query && query.results && query.results.length > 0 && query.results[query.results.length - 1])\n    if ((obj = shibdata.result_cache[query.results[query.results.length - 1].resultid]) !== null)\n      return obj;\n  return null;\n};\nfunction query_second_last_result(query) {\n  var obj = null;\n  if (query && query.results && query.results.length > 1 && query.results[query.results.length - 2])\n    if ((obj = shibdata.result_cache[query.results[query.results.length - 2].resultid]) !== null)\n      return obj;\n  return null;\n};\nfunction query_last_done_result(query) {\n  var last = query_last_result(query);\n  if (last && last.state == 'done')\n    return last;\n  return query_second_last_result(query);\n}\n\nfunction query_result_schema_label(result){\n  return 'fields: ' + result.schema.map(function(field){return field.name + '(' + field.type + ')';}).join(', ');\n};\n\nfunction query_current_state(query) {\n  if (!query)\n    return null;\n  if (query && (! query.queryid))\n    show_error('UI Bug', 'query id unknown', 5, query);\n\n  if (shibdata.query_state_cache[query.queryid])\n    return shibdata.query_state_cache[query.queryid];\n\n  var state = null;\n  var lastresult = query_last_result(query);\n  if (! lastresult)\n    state = 'running';\n  else if (lastresult.state === 'running') {\n    var secondlast = query_second_last_result(query);\n    if (secondlast && secondlast.state === 'done')\n      state = 're-running';\n    else\n      state = 'running';\n  }\n  else if (lastresult.state === 'error')\n    state = 'error';\n  else\n    state = 'executed';\n\n  shibdata.query_state_cache[query.queryid] = state;\n  return state;\n};\n\nfunction timelabel_elapsed(completed_at, executed_at){\n  if (!completed_at || !executed_at)\n    return 'unknown times';\n  var seconds = Math.floor(((new Date(completed_at)) - (new Date(executed_at))) / 1000);\n  if (seconds < 60)\n    return seconds + ' seconds';\n  var minutes = Math.floor(seconds / 60);\n  if (minutes < 60)\n    return minutes + ' minutes';\n  return Math.floor(minutes / 60) + ' hours';\n};\n\n/* uri and history operation */\n\nfunction follow_current_uri() {\n  if (window.location.pathname.indexOf('/q/') === 0) {\n    var queryid = window.location.pathname.substring('/q/'.length);\n    if (/^[0-9a-z]{32}$/.exec(queryid)) // queryid is md5 (16bytes) hexdigest (32chars)\n      follow_current_uri_query(queryid);\n  }\n  if (window.location.pathname.indexOf('/t/') === 0) {\n    var tag = window.location.pathname.substring('/t/'.length);\n    follow_current_uri_tag(tag);\n  }\n};\n\nfunction follow_current_uri_query(queryid){\n  var query = shibdata.query_cache[queryid];\n  if (query) {\n    update_mainview(query);\n    return;\n  }\n\n  authAjax({\n    url: '/query/' + queryid,\n    type: 'GET',\n    cache: false,\n    error: function(jqXHR, textStatus, errorThrown){\n      show_error('Unknown query id', 'cannot get query object with specified id', 10);\n    },\n    success: function(data, textStatus, jqXHR){\n      query = data;\n      shibdata.query_cache[queryid] = query;\n      var resultids = data.results.map(function(v){return v.resultid;});\n      authAjax({\n        url: '/results',\n        type: 'POST',\n        dataType: 'json',\n        data: {ids: resultids},\n        success: function(data){\n          data.results.forEach(function(result1){\n            if (! result1)\n              return;\n            shibdata.result_cache[result1.resultid] = result1;\n          });\n          update_mainview(query);\n        }\n      });\n    }\n  });\n}\n\nfunction follow_current_uri_tag(tag){\n  authAjax({\n    url: '/tagged/' + tag,\n    type: 'GET',\n    cache: false,\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to get detail status', msg);\n    },\n    success: function(queryids) {\n      load_query_tree(queryids, function(){\n        update_tabs(true, {tag:tag, queryids:queryids});\n      });\n    }\n  });\n}\n\nfunction update_history_by_query(query) {\n  if (! window.history.pushState ) // if pushState not ready\n    return;\n  if (query === null) {\n    window.history.pushState('','', '/');\n    return;\n  }\n  window.history.pushState(query.queryid, '', '/q/' + query.queryid);\n};\n\nwindow.addEventListener(\"popstate\", function (event) {\n  if (event.state === null || event.state === undefined || event.state.length < 32)\n    return;\n  var query = shibdata.query_cache[event.state];\n  if (! query) {\n    show_error('UI BUG', 'unknown queryid from history event.state', 10);\n    return;\n  }\n  update_mainview(query);\n}, false);\n\n/* notifications */\n\nvar shib_current_notification = null;\nvar shib_current_notification_counter = 0;\nfunction show_notification(event){ /* event object is not used */\n  if (shib_current_notification === null && shibnotifications.length == 0)\n    return;\n  if (shib_current_notification !== null && shibnotifications.length == 0){\n    shib_current_notification_counter -= 1;\n    if (shib_current_notification_counter < 1) {\n      shib_current_notification.fadeOut(100);\n      shib_current_notification_counter = 0;\n    }\n    return; \n  }\n  var next = shibnotifications.shift();\n  shib_current_notification_counter = ( next.duration || shib_NOTIFICATION_DEFAULT_DURATION_SECONDS ) * 10;\n  if (shib_current_notification) {\n    shib_current_notification.fadeOut(100, function(){\n      shib_current_notification = update_notification(next.type, next.title, next.message);\n      shib_current_notification.fadeIn(100);\n    });\n  }\n  else {\n    shib_current_notification = update_notification(next.type, next.title, next.message);\n    shib_current_notification.fadeIn(100);\n  }\n};\n\nfunction update_notification(type, title, message){\n  if (type === 'info') {\n    $('#infotitle').text(title);\n    $('#infomessage').text(message);\n    return $('#infoarea');\n  }\n  $('#errortitle').text(title);\n  $('#errormessage').text(message);\n  return $('#errorarea');\n};\n\nfunction show_info(title, message, duration){\n  shibnotifications.push({type:'info', title:title, message:message, duration:duration});\n};\n\nfunction show_error(title, message, duration, optional_object){\n  shibnotifications.push({type:'error', title:title, message:message, duration:duration});\n  if (optional_object)\n    console.log(optional_object);\n};\n\n/* dialog */\n\nfunction show_tables_dialog() {\n  $('#tables')\n    .dynatree('destroy')\n    .empty()\n    .hide();\n  $('#tablesdiag').dialog({modal:false, resizable:true, height:400, width:400, maxHeight:650, maxWidth:950});\n  $('#tablesdiag .loadingimg').show();\n\n  var selected = $('#table_pairs option:selected');\n  var engine = selected.data('engine');\n  var dbname = selected.data('database');\n\n  var get_path = '/tables?engine=' + encodeURIComponent(engine) + '&db=' + encodeURIComponent(dbname);\n  authGet(get_path, function(data){\n    $('#tablesdiag .loadingimg').hide();\n    $('#tables')\n      .show()\n      .dynatree({\n        children: data.map(function(v){return {title: v, key: v, isFolder: true, isLazy: true};}),\n        autoFocus: false,\n        autoCollapse: true,\n        clickFolderMode: 2,\n        activeVisible: false,\n        onLazyRead: function(node){\n          node.appendAjax({\n            url: '/partitions',\n            data: { key: node.data.key, engine: engine, db: dbname },\n            cache: false\n          });\n        }\n      });\n  });\n};\n\nfunction show_describe_dialog() {\n  $('#describes')\n    .dynatree('destroy')\n    .empty()\n    .hide();\n  $('#describediag').dialog({modal:false, resizable:true, height:400, width:400, maxHeight:650, maxWidth:950});\n  $('#describediag .loadingimg').show();\n\n  var selected = $('#desc_pairs option:selected');\n  var engine = selected.data('engine');\n  var dbname = selected.data('database');\n\n  var get_path = '/tables?engine=' + encodeURIComponent(engine) + '&db=' + encodeURIComponent(dbname);\n  authGet(get_path, function(data){\n    $('#describediag .loadingimg').hide();\n    $('#describes')\n      .show()\n      .dynatree({\n        children: data.map(function(v){return {title: v, key: v, isFolder: true, isLazy: true};}),\n        autoFocus: false,\n        autoCollapse: true,\n        clickFolderMode: 2,\n        activeVisible: false,\n        onLazyRead: function(node){\n          node.appendAjax({\n            url: '/describe',\n            data: { key: node.data.key, engine: engine, db: dbname },\n            cache: false\n          });\n        }\n      });\n  });\n};\n\n$.template(\"tagForTagListTemplate\", '<li><a href=\"/t/${Tag}\">${Tag}</a></li>');\n\nfunction show_taglist_dialog() {\n  $('ul#taglist').empty().hide();\n\n  $('#taglistdiag').dialog({modal:false, resizable:true, height:400, width:400, maxHeight:650, maxWidth:950});\n  $('#taglistdiag .loadingimg').show();\n\n  authGetJSON('/taglist', function(tags){\n    $.tmpl(\"tagForTagListTemplate\", tags.map(function(t){return {Tag:t};}))\n     .appendTo('ul#taglist');\n    $('#taglistdiag .loadingimg').hide();\n    $('ul#taglist').show();\n  });\n}\n\n$.template(\"detailStatusTemplate\",\n           '<table>' +\n           '<tr><td>Job ID</td><td>${JobID}</td></tr>' +\n           '<tr><td>State</td><td>${State}</td></tr>' +\n           '<tr><td>Priority</td><td>${Priority}</td></tr>' +\n           '<tr><td>URL</td><td><a href=\"${Url}\">${Url}</a></td></tr>' +\n           '<tr><td>Complete</td><td>Map:${MapComplete}, Reduce:${ReduceComplete}</td></tr>' +\n           '</table>');\n$.template(\"detailStatusTemplate2\",\n           '<table>' +\n           '<tr><td>Job ID</td><td>${JobID}</td></tr>' +\n           '<tr><td>State</td><td>${State}</td></tr>' +\n           '<tr><td>Priority</td><td>${Priority}</td></tr>' +\n           '<tr><td>URL</td><td><a href=\"${Url}\">${Url}</a></td></tr>' +\n           '<tr><td>Complete</td><td>${Complete}</td></tr>' +\n           '</table>');\nfunction show_status_dialog(target) {\n  $('#detailstatus').empty().hide();\n  $('#detailstatusdiag').dialog({modal:true, resizable:false, height:200, width:600, maxHeight:200, maxWidth:950});\n  $('#detailstatusdiag .loadingimg').show();\n  authAjax({\n    url: '/detailstatus/' + target.queryid,\n    type: 'GET',\n    cache: false,\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to get detail status', msg);\n    },\n    success: function(state) {\n      /*\n       var returnedValus = {\n         jobid: 'job_201304011701_1912',\n         name: 'shib-3578d8d4f5a1812de7a7714f5b108776',\n         priority: 'NORMAL',\n         state: 'RUNNING',\n         trackingURL: 'http://master.hadoop.local:50030/jobdetails.jsp?jobid=job_201304011701_1912',\n         startTime: 'Thu Apr 11 2013 16:06:40 (JST)',\n         mapComplete: 89,\n         reduceComplete: 29,\n         complete: 80,\n         hiveQueryId: 'hive_20130411160606_46b1b669-3a64-4174-899e-bb1bf53e90db',\n         hiveQueryString: 'SELECT ...'\n       };\n       // \"complete\" and \"mapComplete/reduceComplete\" are exclusive\n       */\n      var template = \"detailStatusTemplate\";\n      var out = {\n          JobID: state['jobid'], State: state['state'], Priority: state['priority'],\n          Url: state['trackingURL']\n      };\n      if (state['complete']) {\n        template = \"detailStatusTemplate2\";\n        out['Complete'] = String(state['complete'] || 0) + '%';\n      } else {\n        out['MapComplete'] = String(state['mapComplete'] || 0) + '%';\n        out['ReduceComplete'] = String(state['ReduceComplete'] || 0) + '%';\n      }\n\n      $.tmpl(template,[ out ]).appendTo('#detailstatus');\n      $('#detailstatusdiag .loadingimg').hide();\n      $('#detailstatus').show();\n    }\n  });\n}\n\n$.template('removeTagOptionTemplate', '<option>${Tag}</option>');\n\nfunction show_edit_tag_dialog(){\n  var query = shibselectedquery;\n  $('input#add_tag_text').val('');\n  $('select#remove_tag_list').empty();\n  $('#removeTagPart').hide();\n\n  authAjax({\n    url: '/tags/' + query.queryid,\n    type: 'GET',\n    cache: false,\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to get detail status', msg);\n    },\n    success: function(tags) {\n      if (tags.length > 0) {\n        $.tmpl(\"removeTagOptionTemplate\", tags.map(function(t){return {Tag:t};}))\n          .appendTo('select#remove_tag_list');\n        $('#removeTagPart').show();\n      }\n\n      $('#edittagdiag').dialog({modal:true, resizable:false, height:100, width:250});\n    }\n  });\n}\n\nfunction execute_add_tag(){\n  var query = shibselectedquery;\n  authAjax({\n    url: '/addtag',\n    type: 'POST',\n    cache: false,\n    data: { queryid: query.queryid, tag: $('input#add_tag_text').val() },\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to add a tag', msg);\n    },\n    success: function(state) {\n      $('#edittagdiag').dialog('close');\n      show_editbox_querytags(query);\n    }\n  });\n}\n\nfunction execute_remove_tag(){\n  var query = shibselectedquery;\n  authAjax({\n    url: '/deletetag',\n    type: 'POST',\n    cache: false,\n    data: { queryid: query.queryid, tag: $('select#remove_tag_list').val() },\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to remove a tag', msg);\n    },\n    success: function(state) {\n      $('#edittagdiag').dialog('close');\n      show_editbox_querytags(query);\n    }\n  });\n}\n\nfunction show_auth_dialog(){\n  $('#authinputdiag').dialog({modal:true, resizable:false, height:150, width:400});\n}\n\n/* right pane operations */\n\nfunction update_tabs(reloading, taginfo, history_disabled) {\n  if (reloading) {\n    $('#listSelector').tabs('destroy');\n    if (window.localStorage) {\n      $('#tab-yours').accordion('destroy');\n      $('#tab-bookmark').accordion('destroy');\n    }\n    $('#tab-tag').accordion('destroy');\n    $('#tab-history').accordion('destroy');\n  }\n\n  if (window.localStorage) {\n    update_yours_tab();\n    update_bookmark_tab();\n    $(\"#tab-yours\").accordion({header:\"h3\", autoHeight:false});\n    $(\"#tab-bookmark\").accordion({header:\"h3\", autoHeight:false});\n  }\n  else {\n    $('#index-yours,#tab-yours').remove();\n    $('#index-bookmark,#tab-bookmark').remove();\n  }\n\n  if (history_disabled) {\n    $('#tab-history').empty();\n  } else {\n    update_history_tab(reloading);\n    $(\"#tab-history\").accordion({header:\"h3\", autoHeight:false});\n  }\n\n  if (taginfo) {\n    if ($('#listSelector ul li#index-tag').size() === 0){\n      $('#listSelector ul li#index-yours').before('<li id=\"index-tag\"><a href=\"#tab-tag\"> tag</a></li>');\n      $('#listSelector div#tab-yours').before('<div id=\"tab-tag\"></div>');\n    }\n    update_tag_tab(taginfo.tag, taginfo.queryids);\n    $('#tab-tag').accordion({header:\"h3\", autoHeight:false});\n  } else {\n    $('#index-tag,#tab-tag').remove();\n  }\n\n  $(\"#listSelector\").tabs();\n\n  $('.queryitem').click(select_queryitem);\n};\n\nfunction load_tabs(opts) {\n  var history_disabled = false;\n  var callback = function() {\n    update_tabs(opts.reload, opts.taginfo, history_disabled);\n    if (opts.callback)\n      opts.callback();\n  };\n\n  shibdata.query_cache = {};\n  shibdata.query_state_cache = {};\n  shibdata.result_cache = {};\n\n  authGetJSON('/summary_bulk', function(data){\n    if (data.disabled) {\n      history_disabled = true;\n    } else {\n      shibdata.history = data.history; /* [\"201302\", \"201301\", \"201212\", \"201211\"] */\n      shibdata.history_ids = data.history_ids; /* {\"201302\":[query_ids], \"201301\":[query_ids], ...} */\n    }\n\n    /* data.query_ids is sum of values of history_ids */\n    var queryids = (data.query_ids || []).concat( execute_query_list() ).concat( bookmark_query_list() );\n    load_query_tree(queryids, callback);\n  });\n};\n\n$.template(\"queryItemTemplate\",\n           '<div><div class=\"queryitem\" id=\"query-${QueryId}\">' +\n           '  <div class=\"queryitem_information\"><table><tr>' +\n           '    <td width=\"80%\">${Information}</td>' +\n           '    <td width=\"20%\" style=\"text-align: right;\"><a href=\"/q/${QueryKey}\">URL</a></td>' +\n           '  </tr></table></div>' +\n           '  <div class=\"queryitem_statement\">${Statement}</div>' +\n           '  <div class=\"queryitem_status\">' +\n           '    <span class=\"status_${Status}\">${Status}</span>' +\n           '    <span class=\"queryitem_etc\">${Etc}</span>' +\n           '    ' +\n           '  </div>' +\n           '</div></div>');\n\nfunction create_queryitem_object(queryid, id_prefix){\n  var query = shibdata.query_cache[queryid];\n  if (! query)\n    return '';\n  var lastresult = query_last_result(query);\n  var executed_at = (lastresult && lastresult.executed_at) || '-';\n  return {\n    QueryKey: query.queryid,\n    QueryId: (id_prefix || '') + query.queryid,\n    Information: executed_at,\n    Statement: query.querystring,\n    Status: query_current_state(query),\n    Etc: lastresult ?\n      (timelabel_elapsed(lastresult.completed_at, lastresult.executed_at) +\n       ((lastresult && lastresult.bytes && lastresult.lines &&\n         (', ' + lastresult.bytes + ' bytes, ' + lastresult.lines + ' lines')) || '')\n      ) : 'waiting'\n  };\n};\n\nfunction update_yours_tab(){\n  $('#tab-yours')\n    .empty()\n    .append('<div><h3><a href=\"#\">your queries</a></h3><div id=\"yours-idlist\"></div></div>');\n  if (execute_query_list().length > 0)\n    $.tmpl(\"queryItemTemplate\",\n           execute_query_list().map(function(id){return create_queryitem_object(id, 'yours-');})\n          ).appendTo('#tab-yours div div#yours-idlist');\n};\n\nfunction update_bookmark_tab(){\n  $('#tab-bookmark')\n    .empty()\n    .append('<div><h3><a href=\"#\">bookmark</a></h3><div id=\"bookmark-idlist\"></div></div>');\n  if (bookmark_query_list().length > 0)\n    $.tmpl(\"queryItemTemplate\",\n           bookmark_query_list().map(function(id){return create_queryitem_object(id, 'bookmark-');})\n          ).appendTo('#tab-bookmark div div#bookmark-idlist');\n};\n\nfunction update_history_tab(){\n  var history_num = 1;\n  $('#tab-history').empty();\n  shibdata.history.forEach(function(history1){\n    var historyitemlistid = 'history-idlist-' + history_num;\n    $('#tab-history').append('<div><h3><a href=\"#\">' + history1 + '</a></h3><div id=\"' + historyitemlistid + '\"></div></div>');\n    $.tmpl(\"queryItemTemplate\",\n           shibdata.history_ids[history1].map(function(id){\n             return create_queryitem_object(id, 'history-');})\n          ).appendTo('#tab-history div div#' + historyitemlistid);\n    history_num += 1;\n  });\n};\n\nfunction update_tag_tab(tag, queryids){\n  $('#tab-tag')\n      .empty()\n      .append('<div><h3><a href=\"#\">TAG:' + tag + '</a></h3><div id=\"tag-idlist\"></div></div>');\n  if (queryids.length > 0)\n    $.tmpl(\"queryItemTemplate\", queryids.map(function(id){return create_queryitem_object(id, 'tag-');}))\n     .appendTo('#tab-tag div div#tag-idlist');\n}\n\nfunction deselect_and_new_query(quiet){\n  release_selected_query();\n  update_editbox(null);\n  if (! quiet)\n    show_info('', 'selected query released', 5);\n};\n\nfunction set_selected_query(query, dom){\n  release_selected_query();\n  $(dom).addClass('queryitem_selected');\n  shibselectedquery_dom = dom;\n  shibselectedquery = query;\n};\n\nfunction release_selected_query(){\n  if (! shibselectedquery)\n    return;\n  $(shibselectedquery_dom).removeClass('queryitem_selected');\n  shibselectedquery_dom = null;\n  shibselectedquery = null;\n};\n\nfunction select_queryitem(event){\n  var target_dom = $(event.target).closest('.queryitem');\n  var target_dom_id = target_dom.attr('id');\n  var dom_id_regex = /^query-(yours|bookmark|history|tag)-([0-9a-f]+)$/;\n  var match_result = dom_id_regex.exec(target_dom_id);\n  if (match_result === null) {\n    show_error(\"UI Bug\", \"Selected DOM id invalid:\" + target_dom_id, 5);\n    return;\n  }\n  var query = shibdata.query_cache[match_result[2]];\n  if (! query) {\n    show_error(\"UI Bug\", \"Selected query not loaded on browser:\" + match_result[2], 5);\n    return;\n  }\n  \n  set_selected_query(query, target_dom);\n  update_history_by_query(query);\n  update_mainview(query);\n};\n\n/* left pane view updates */\n\nfunction initiate_mainview(eventNotUsed, quiet) {\n  deselect_and_new_query(quiet);\n  update_queryeditor(true, '');\n  update_editbox(null, 'not executed');\n  update_history_by_query(null);\n};\n\nfunction copy_selected_query(eventNotUsed) {\n  var querystring = shibselectedquery.querystring;\n  var engine = shibselectedquery.engine;\n  var dbname = shibselectedquery.dbname;\n  deselect_and_new_query();\n  update_queryeditor(true, querystring);\n  update_editbox(null, 'not executed');\n  var exec_pairs_value = null;\n  $('select#exec_pairs option').each(function(i,element){\n    var e = $(element);\n    if (e.data('engine') === engine && e.data('database') === dbname)\n      exec_pairs_value = e.val();\n  });\n  if (! exec_pairs_value)\n    exec_pairs_value = $($('select#exec_pairs option')[0]).val();\n  $('select#exec_pairs').val(exec_pairs_value);\n  update_history_by_query(null);\n};\n\nfunction clip_selected_query(eventNotUsed) {\n  var clip_query_id = shibselectedquery.queryid;\n  push_bookmark_query_list(clip_query_id);\n  load_tabs({\n    reload:true,\n    callback:function(){\n      $(\"#listSelector\").tabs('option', 'selected', 1);\n    }\n  });\n  update_editbox(shibselectedquery);\n};\n\nfunction unclip_selected_query(eventNotUsed) {\n  var unclip_query_id = shibselectedquery.queryid;\n  delete_bookmark_query_list(unclip_query_id);\n  load_tabs({\n    reload:true,\n    callback:function(){\n      $(\"#listSelector\").tabs('option', 'selected', 1);\n    }\n  });\n  update_editbox(shibselectedquery);\n};\n\nfunction update_mainview(query){\n  shibselectedquery = query;\n  update_queryeditor(false, query.querystring);\n  update_editbox(query);\n};\n\nfunction update_queryeditor(editable, querystring) {\n  var editor = $('#queryeditor');\n  editor.val(querystring);\n  if (editable)\n    editor.attr('readonly', false).removeClass('readonly');\n  else\n    editor.attr('readonly', true).addClass('readonly');\n};\n\nfunction update_editbox(query, optional_state) {\n  if (query) {\n    $('#copy_button').show();\n    if (exists_in_bookmark_query_list(query.queryid)) {\n      $('#clip_button').hide();\n      $('#unclip_button').show();\n    } else {\n      $('#clip_button').show();\n      $('#unclip_button').hide();\n    }\n  } else {\n    $('#copy_button,#clip_button,#unclip_button').hide();\n  }\n\n  show_query_exec_pairs(query);\n\n  var state = optional_state || query_current_state(query);\n  switch (state) {\n  case 'not executed':\n  case undefined:\n  case null:\n    $('#engineselector').show();\n    if (authInfo) {\n      show_editbox_buttons(['execute_button']);\n    } else {\n      show_editbox_buttons(['auth_button']);\n    }\n    change_editbox_querystatus_style(query, 'not executed');\n    show_editbox_querytags(null);\n    break;\n  case 'running':\n    $('#engineselector').hide();\n    if (engineInfo && engineInfo.monitor[query.engine]) {\n      show_editbox_buttons(['giveup_button', 'status_button']);\n    }\n    else {\n      show_editbox_buttons(['giveup_button']);\n    }\n    change_editbox_querystatus_style(query, 'running');\n    show_editbox_querytags(null);\n    break;\n  case 'executed':\n  case 'done':\n    $('#engineselector').hide();\n    show_editbox_buttons(['delete_button', 'display_full_button', 'display_head_button',\n                          'download_tsv_button', 'download_csv_button']);\n    change_editbox_querystatus_style(query, 'executed', query_last_result(query));\n    show_editbox_querytags(query);\n    break;\n  case 'error':\n    $('#engineselector').hide();\n    show_editbox_buttons(['delete_button']);\n    change_editbox_querystatus_style(query, 'error', query_last_result(query));\n    show_editbox_querytags(null);\n    break;\n  default:\n    show_error('UI Bug', 'unknown query status:' + state, 5, query);\n  }\n}\n\nfunction show_editbox_buttons(buttons){\n  var allbuttons = [\n    'auth_button', 'execute_button', 'giveup_button', 'status_button', 'delete_button',\n    'display_full_button', 'display_head_button', 'download_tsv_button', 'download_csv_button'\n  ];\n  if (! buttons)\n    buttons = [];\n  allbuttons.forEach(function(b){\n    if (buttons.indexOf(b) > -1)\n      $('li#' + b).show();\n    else\n      $('li#' + b).hide();\n  });\n}\n\nfunction show_query_exec_pairs(query){\n  if (!query || !query.engine) {\n    $('#queryexec').hide();\n    $('span#queryengine').text('');\n    $('span#querydatabase').text('');\n  }\n  else {\n    $('span#queryengine').text(query.engine);\n    $('span#querydatabase').text(query.dbname || '(default)');\n    $('#queryexec').show();\n  }\n}\n\nfunction change_editbox_querystatus_style(query, state, result){\n  var allstates = {\n    'not executed':{classname:'status_not_executed', result:false},\n    'running':{classname:'status_running', result:false},\n    'executed':{classname:'status_executed', result:true},\n    'error':{classname:'status_error', result:true},\n    're-running':{classname:'status_re-running', result:true}\n  };\n  if (state === 'done')\n    state = 'executed';\n\n  if (allstates[state]) {\n    var allclasses = 'status_not_executed status_running status_executed status_error status_re-running';\n    $('span#querystatus')\n      .removeClass(allclasses)\n      .addClass((allstates[state]).classname)\n      .text(state);\n\n    if (allstates[state]['result'] && result) {\n      $('#queryresult').show();\n      if (result.error) {\n        $('span#queryresultlines').text(result.error);\n        $('span#queryresultbytes').text(\"\");\n        $('#queryresultelapsed').text(timelabel_elapsed(result.completed_at, result.executed_at));\n        $('#queryresultschema').text('');\n      }\n      else {\n        $('span#queryresultlines').text(\" \" + result.lines + \" lines, \");\n        $('span#queryresultbytes').text(\" \" + result.bytes + \" bytes\");\n        $('#queryresultelapsed').text(timelabel_elapsed(result.completed_at, result.executed_at));\n        $('#queryresultschema').text(query_result_schema_label(result));\n      }\n    }\n    else {\n      $('#queryresult').hide();\n    }\n  }\n}\n\n$.template(\"queryTagTemplate\",\n    '<li class=\"tag ui-state-default ui-corner-all\" data-tagtext=\"${Tag}\">' +\n    '<span class=\"ui-icon ui-icon-search\"></span> <a href=\"/t/${Tag}\">${Tag}</a>' +\n    '</li>');\n\nfunction show_editbox_querytags(query){\n  $('ul#querytags li.tag').remove();\n  if (query === null || query === undefined) {\n    $('ul#querytags').hide();\n    return;\n  }\n\n  $('ul#querytags').show();\n  authAjax({\n    url: '/tags/' + query.queryid,\n    type: 'GET',\n    cache: false,\n    error: function(jqXHR, textStatus, err) {\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try { msg = JSON.parse(jqXHR.responseText).message; }\n      catch (e) { msg = jqXHR.responseText; }\n      show_error('Failed to get detail status', msg);\n    },\n    success: function(tags) {\n      $.tmpl(\"queryTagTemplate\",\n          tags.map(function(tag){ return {Tag:tag}; }))\n       .appendTo('ul#querytags');\n    }\n  });\n}\n\n\n/* query and result load/reload/caching */\n\nfunction load_query_tree(queryids, callback){\n  load_queries(queryids, function(err, queries){\n    var resultids = [];\n    queries.forEach(function(v){\n      if (v.results && v.results.length > 0)\n        resultids = resultids.concat(v.results.map(function(r){return r && r.resultid;}));\n    });\n    // load_results does not call ajax when argument is empty\n    load_results(resultids, function(err, results){callback();});\n  });\n}\n\nfunction load_queries(queryids, callback){\n  if (queryids.length < 1) {\n    callback(null, []); return;\n  }\n  authAjax({\n    url: '/queries',\n    type: 'POST',\n    dataType: 'json',\n    data: {ids: queryids},\n    success: function(data){\n      data.queries.forEach(function(query1){\n        shibdata.query_cache[query1.queryid] = query1;\n      });\n      if (callback)\n        callback(null, data.queries);\n    }\n  });\n};\n\nfunction load_results(resultids, callback){\n  if (resultids.length < 1) {\n    callback(null, []); return;\n  }\n  authAjax({\n    url: '/results',\n    type: 'POST',\n    dataType: 'json',\n    data: {ids: resultids},\n    success: function(data){\n      data.results.forEach(function(result1){\n        if (! result1)\n          return;\n        shibdata.result_cache[result1.resultid] = result1;\n      });\n      if (callback)\n        callback(null, data.results);\n    }\n  });\n};\n\n/* query status auto-updates */\n\nfunction check_selected_running_query_state(event){ /* event object is not used */\n  if (! shibselectedquery)\n    return;\n  var s = query_current_state(shibselectedquery);\n  if (s === 'running' || s === 're-running')\n    update_query(shibdata.query_cache[shibselectedquery.queryid]);\n};\n\nfunction update_query_display(query) {\n  update_mainview(query);\n  show_info('Query state updated', '', 5);\n  load_tabs({reload:true});\n};\n\nfunction update_query(query){\n  if (! query)\n    return;\n  authGet('/status/' + query.queryid, function(data){\n    if (query_current_state(query) == data)\n      return;\n\n    shibdata.query_state_cache[query.queryid] = data;\n\n    authGet('/query/' + query.queryid, function(new_query){\n      shibdata.query_cache[new_query.queryid] = new_query;\n      if (new_query.results.length > 0) {\n        authGet('/lastresult/' + new_query.queryid, function(new_result){\n          shibdata.result_cache[new_result.resultid] = new_result;\n          update_query_display(new_query);\n        });\n      }\n      else {\n        update_query_display(new_query);\n      }\n    });\n  });\n};\n\n$.template(\"runningsTemplate\",\n           '<div><a href=\"/q/${QueryId}\">${QueryId}</a> ${Runnings}</div>');\n\nfunction update_running_queries(event){\n  authGet('/runnings', function(data){\n    $('#runnings').empty();\n    if (data.length < 1) {\n      $('<div>no running queries</div>').appendTo('#runnings');\n      return;\n    }\n    $('#runnings').show();\n    $.tmpl(\"runningsTemplate\",\n           data.map(function(pair){return {QueryId: pair[0], Runnings: pair[1]};})\n          ).appendTo('#runnings');\n  });\n};\n\n/* left pane interactions (user-operation interactions) */\n\nfunction check_auth(e) {\n  e.preventDefault();\n\n  var username = $('#username').val();\n  var password = $('#password').val();\n  authAjax({\n    type: \"POST\",\n    url: '/auth',\n    data: {username: username, password: password},\n    cache: false,\n    success: function(data, textStatus, jqXHR){\n      authInfo = data.authInfo;\n      if ($('#auth_button:visible').size() > 0)\n        show_editbox_buttons(['execute_button']);\n      $('#authinputdiag').dialog('close');\n      show_info('User/Pass check', 'success');\n      load_pairs(); // reload engine-database pairs w/ authenticated username\n    },\n    error: function(jqXHR, textStatus, errorThrown){\n      authInfo = null;\n      $('#authinputdiag').dialog('close');\n      show_error('User/Pass check', 'failed', 10);\n    }\n  });\n}\n\nfunction execute_query() {\n  if (! authInfo) {\n    show_error('UI Bug', 'check authentication at first!');\n    return;\n  }\n  if (shibselectedquery) {\n    show_error('UI Bug', 'execute_query should be enable with not-saved-query objects');\n    return;\n  }\n  var selected = $('#exec_pairs option:selected');\n  var engine = selected.data('engine');\n  var dbname = selected.data('database');\n\n  var querystring = $('#queryeditor').val();\n  var postdata = {\n    engineLabel: engine,\n    dbname: dbname,\n    querystring: querystring,\n    authInfo: authInfo\n  };\n\n  authAjax({\n    url: '/execute',\n    type: 'POST',\n    dataType: 'json',\n    data: postdata,\n    error: function(jqXHR, textStatus, err){\n      var msg = null;\n      try {\n        msg = JSON.parse(jqXHR.responseText).message;\n      }\n      catch (e) {\n        msg = jqXHR.responseText;\n      }\n      show_error('Cannot Execute Query', msg);\n    },\n    success: function(query){\n      show_info('Query now waiting to run', '');\n      shibdata.query_cache[query.queryid] = query;\n      update_mainview(query);\n      if (window.localStorage) {\n        push_execute_query_list(query.queryid);\n      }\n      update_history_by_query(query);\n      load_tabs({reload:true});\n    }\n  });\n};\n\nfunction giveup_query() {\n  if (! shibselectedquery) {\n    show_error('UI Bug', 'giveup_query should be enable with non-saved-query objects');\n    return;\n  }\n  authAjax({\n    url: '/giveup',\n    type: 'POST',\n    dataType: 'json',\n    data: {queryid: shibselectedquery.queryid},\n    error: function(jqXHR, textStatus, err){\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try {\n        msg = JSON.parse(jqXHR.responseText).message;\n      }\n      catch (e) {\n        msg = jqXHR.responseText;\n      }\n      show_error('Cannot GiveUp Query', msg);\n    },\n    success: function(query){\n      show_info('Query gived-up', '');\n      shibdata.query_cache[query.queryid] = query;\n      shibdata.query_state_cache[query.queryid] = 'error';\n      load_results(query.results.map(function(v){return v.resultid;}), function(err){\n        update_mainview(query);\n        load_tabs({reload:true});\n      });\n    }\n  });\n};\n\nfunction show_status_query(eventNotUsed) {\n  if (! shibselectedquery)\n    return;\n  if (! engineInfo || !engineInfo.monitor[shibselectedquery.engine])\n    return;\n  show_status_dialog(shibselectedquery);\n}\n\nfunction delete_query(event) {\n  if (! shibselectedquery)\n    return;\n  var target = shibselectedquery;\n  authAjax({\n    url: '/delete',\n    type: 'POST',\n    dataType: 'json',\n    data: {queryid: target.queryid},\n    error: function(jqXHR, textStatus, err){\n      console.log(jqXHR);\n      console.log(textStatus);\n      var msg = null;\n      try {\n        msg = JSON.parse(jqXHR.responseText).message;\n      }\n      catch (e) {\n        msg = jqXHR.responseText;\n      }\n      show_error('Failed to delete query', msg);\n    },\n    success: function(data){\n      show_info('Selected query successfully deleted', '');\n      initiate_mainview(null, true);\n      delete_execute_query_item(target.queryid);\n      load_tabs({reload:true});\n    }\n  });\n};\n\nfunction show_result_query(opts) { /* opts: {range:full/head} */\n  var size = 'full';\n  var height = 400;\n  var width = 600;\n  if (opts.range == 'head'){\n    size = 'head';\n    height = 200;\n  }\n  authGetText('/show/' + size + '/' + query_last_done_result(shibselectedquery).resultid, function(data){\n    $('pre#resultdisplay').text(data);\n    $('#resultdiag').dialog({modal:true, resizable:true, height:400, width:600, maxHeight:650, maxWidth:950});\n  });\n};\n\nfunction download_result_query(opts) { /* opts: {format:tsv/csv} */\n  var format = 'tsv';\n  if (opts.format == 'csv') {\n    format = 'csv';\n  }\n  window.location = '/download/' + format + '/' + query_last_done_result(shibselectedquery).resultid;\n};\n"
  },
  {
    "path": "src/hiveserver/if/TCLIService.thrift",
    "content": "// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements.  See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership.  The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License.  You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Coding Conventions for this file:\n//\n// Structs/Enums/Unions\n// * Struct, Enum, and Union names begin with a \"T\",\n//   and use a capital letter for each new word, with no underscores.\n// * All fields should be declared as either optional or required.\n//\n// Functions\n// * Function names start with a capital letter and have a capital letter for\n//   each new word, with no underscores.\n// * Each function should take exactly one parameter, named TFunctionNameReq,\n//   and should return either void or TFunctionNameResp. This convention allows\n//   incremental updates.\n//\n// Services\n// * Service names begin with the letter \"T\", use a capital letter for each\n//   new word (with no underscores), and end with the word \"Service\".\n\nnamespace java org.apache.hive.service.cli.thrift\nnamespace cpp apache.hive.service.cli.thrift\n\n// List of protocol versions. A new token should be\n// added to the end of this list every time a change is made.\nenum TProtocolVersion {\n  HIVE_CLI_SERVICE_PROTOCOL_V1\n}\n\nenum TTypeId {\n  BOOLEAN_TYPE,\n  TINYINT_TYPE,\n  SMALLINT_TYPE,\n  INT_TYPE,\n  BIGINT_TYPE,\n  FLOAT_TYPE,\n  DOUBLE_TYPE,\n  STRING_TYPE,\n  TIMESTAMP_TYPE,\n  BINARY_TYPE,\n  ARRAY_TYPE,\n  MAP_TYPE,\n  STRUCT_TYPE,\n  UNION_TYPE,\n  USER_DEFINED_TYPE,\n  DECIMAL_TYPE\n}\n  \nconst set<TTypeId> PRIMITIVE_TYPES = [\n  TTypeId.BOOLEAN_TYPE\n  TTypeId.TINYINT_TYPE\n  TTypeId.SMALLINT_TYPE\n  TTypeId.INT_TYPE\n  TTypeId.BIGINT_TYPE\n  TTypeId.FLOAT_TYPE\n  TTypeId.DOUBLE_TYPE\n  TTypeId.STRING_TYPE\n  TTypeId.TIMESTAMP_TYPE\n  TTypeId.BINARY_TYPE,\n  TTypeId.DECIMAL_TYPE\n]\n\nconst set<TTypeId> COMPLEX_TYPES = [\n  TTypeId.ARRAY_TYPE\n  TTypeId.MAP_TYPE\n  TTypeId.STRUCT_TYPE\n  TTypeId.UNION_TYPE\n  TTypeId.USER_DEFINED_TYPE\n]\n\nconst set<TTypeId> COLLECTION_TYPES = [\n  TTypeId.ARRAY_TYPE\n  TTypeId.MAP_TYPE\n]\n\nconst map<TTypeId,string> TYPE_NAMES = {\n  TTypeId.BOOLEAN_TYPE: \"BOOLEAN\",\n  TTypeId.TINYINT_TYPE: \"TINYINT\",\n  TTypeId.SMALLINT_TYPE: \"SMALLINT\",\n  TTypeId.INT_TYPE: \"INT\",\n  TTypeId.BIGINT_TYPE: \"BIGINT\",\n  TTypeId.FLOAT_TYPE: \"FLOAT\",\n  TTypeId.DOUBLE_TYPE: \"DOUBLE\",\n  TTypeId.STRING_TYPE: \"STRING\",\n  TTypeId.TIMESTAMP_TYPE: \"TIMESTAMP\",\n  TTypeId.BINARY_TYPE: \"BINARY\",\n  TTypeId.ARRAY_TYPE: \"ARRAY\",\n  TTypeId.MAP_TYPE: \"MAP\",\n  TTypeId.STRUCT_TYPE: \"STRUCT\",\n  TTypeId.UNION_TYPE: \"UNIONTYPE\"\n  TTypeId.DECIMAL_TYPE: \"DECIMAL\"\n}\n\n// Thrift does not support recursively defined types or forward declarations,\n// which makes it difficult to represent Hive's nested types.\n// To get around these limitations TTypeDesc employs a type list that maps\n// integer \"pointers\" to TTypeEntry objects. The following examples show\n// how different types are represented using this scheme:\n//\n// \"INT\":\n// TTypeDesc {\n//   types = [\n//     TTypeEntry.primitive_entry {\n//       type = INT_TYPE\n//     }\n//   ]\n// }\n//\n// \"ARRAY<INT>\":\n// TTypeDesc {\n//   types = [\n//     TTypeEntry.array_entry {\n//       object_type_ptr = 1\n//     },\n//     TTypeEntry.primitive_entry {\n//       type = INT_TYPE\n//     }\n//   ]\n// }\n//\n// \"MAP<INT,STRING>\":\n// TTypeDesc {\n//   types = [\n//     TTypeEntry.map_entry {\n//       key_type_ptr = 1\n//       value_type_ptr = 2\n//     },\n//     TTypeEntry.primitive_entry {\n//       type = INT_TYPE\n//     },\n//     TTypeEntry.primitive_entry {\n//       type = STRING_TYPE\n//     }\n//   ]\n// }\n\ntypedef i32 TTypeEntryPtr\n\n// Type entry for a primitive type.\nstruct TPrimitiveTypeEntry {\n  // The primitive type token. This must satisfy the condition\n  // that type is in the PRIMITIVE_TYPES set.\n  1: required TTypeId type\n}\n\n// Type entry for an ARRAY type.\nstruct TArrayTypeEntry {\n  1: required TTypeEntryPtr objectTypePtr\n}\n\n// Type entry for a MAP type.\nstruct TMapTypeEntry {\n  1: required TTypeEntryPtr keyTypePtr\n  2: required TTypeEntryPtr valueTypePtr\n}\n\n// Type entry for a STRUCT type.\nstruct TStructTypeEntry {\n  1: required map<string, TTypeEntryPtr> nameToTypePtr\n}\n\n// Type entry for a UNIONTYPE type.\nstruct TUnionTypeEntry {\n  1: required map<string, TTypeEntryPtr> nameToTypePtr\n}\n\nstruct TUserDefinedTypeEntry {\n  // The fully qualified name of the class implementing this type.\n  1: required string typeClassName\n}\n\n// We use a union here since Thrift does not support inheritance.\nunion TTypeEntry {\n  1: TPrimitiveTypeEntry primitiveEntry\n  2: TArrayTypeEntry arrayEntry\n  3: TMapTypeEntry mapEntry\n  4: TStructTypeEntry structEntry\n  5: TUnionTypeEntry unionEntry\n  6: TUserDefinedTypeEntry userDefinedTypeEntry\n}\n\n// Type descriptor for columns.\nstruct TTypeDesc {\n  // The \"top\" type is always the first element of the list.\n  // If the top type is an ARRAY, MAP, STRUCT, or UNIONTYPE\n  // type, then subsequent elements represent nested types.\n  1: required list<TTypeEntry> types\n}\n\n// A result set column descriptor.\nstruct TColumnDesc {\n  // The name of the column\n  1: required string columnName\n\n  // The type descriptor for this column\n  2: required TTypeDesc typeDesc\n  \n  // The ordinal position of this column in the schema\n  3: required i32 position\n\n  4: optional string comment\n}\n\n// Metadata used to describe the schema (column names, types, comments)\n// of result sets.\nstruct TTableSchema {\n  1: required list<TColumnDesc> columns\n}\n\n// A Boolean column value.\nstruct TBoolValue {\n  // NULL if value is unset.\n  1: optional bool value\n}\n\n// A Byte column value.\nstruct TByteValue {\n  // NULL if value is unset.\n  1: optional byte value\n}\n\n// A signed, 16 bit column value.\nstruct TI16Value {\n  // NULL if value is unset\n  1: optional i16 value\n}\n\n// A signed, 32 bit column value\nstruct TI32Value {\n  // NULL if value is unset\n  1: optional i32 value\n}\n\n// A signed 64 bit column value\nstruct TI64Value {\n  // NULL if value is unset\n  1: optional i64 value\n}\n\n// A floating point 64 bit column value\nstruct TDoubleValue {\n  // NULL if value is unset\n  1: optional double value\n}\n\nstruct TStringValue {\n  // NULL if value is unset\n  1: optional string value\n}\n\nunion TColumn {\n  1: list<TBoolValue> boolColumn\n  2: list<TByteValue> byteColumn\n  3: list<TI16Value> i16Column\n  4: list<TI32Value> i32Column\n  5: list<TI64Value> i64Column\n  6: list<TDoubleValue> doubleColumn\n  7: list<TStringValue> stringColumn\n}\n\n// A single column value in a result set.\n// Note that Hive's type system is richer than Thrift's,\n// so in some cases we have to map multiple Hive types\n// to the same Thrift type. On the client-side this is\n// disambiguated by looking at the Schema of the\n// result set.\nunion TColumnValue {\n  1: TBoolValue   boolVal      // BOOLEAN\n  2: TByteValue   byteVal      // TINYINT\n  3: TI16Value    i16Val       // SMALLINT\n  4: TI32Value    i32Val       // INT\n  5: TI64Value    i64Val       // BIGINT, TIMESTAMP\n  6: TDoubleValue doubleVal    // FLOAT, DOUBLE\n  7: TStringValue stringVal    // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL\n}\n\n// Represents a row in a rowset.\nstruct TRow {\n  1: required list<TColumnValue> colVals\n}\n\n// Represents a rowset\nstruct TRowSet {\n  // The starting row offset of this rowset.\n  1: required i64 startRowOffset\n  2: required list<TRow> rows\n  3: optional list<TColumn> columns\n}\n\n// The return status code contained in each response.\nenum TStatusCode {\n  SUCCESS_STATUS,\n  SUCCESS_WITH_INFO_STATUS,\n  STILL_EXECUTING_STATUS,\n  ERROR_STATUS,\n  INVALID_HANDLE_STATUS\n}\n\n// The return status of a remote request\nstruct TStatus {\n  1: required TStatusCode statusCode\n\n  // If status is SUCCESS_WITH_INFO, info_msgs may be populated with\n  // additional diagnostic information.\n  2: optional list<string> infoMessages\n\n  // If status is ERROR, then the following fields may be set\n  3: optional string sqlState  // as defined in the ISO/IEF CLI specification\n  4: optional i32 errorCode    // internal error code\n  5: optional string errorMessage\n}\n\n// The state of an operation (i.e. a query or other\n// asynchronous operation that generates a result set)\n// on the server.\nenum TOperationState {\n  // The operation has been initialized\n  INITIALIZED_STATE,\n\n  // The operation is running. In this state the result\n  // set is not available.\n  RUNNING_STATE,\n\n  // The operation has completed. When an operation is in\n  // this state its result set may be fetched.\n  FINISHED_STATE,\n\n  // The operation was canceled by a client\n  CANCELED_STATE,\n\n  // The operation was closed by a client\n  CLOSED_STATE,\n\n  // The operation failed due to an error\n  ERROR_STATE,\n\n  // The operation is in an unrecognized state\n  UKNOWN_STATE,\n}\n\n\n// A string identifier. This is interpreted literally.\ntypedef string TIdentifier\n\n// A search pattern.\n//\n// Valid search pattern characters:\n// '_': Any single character.\n// '%': Any sequence of zero or more characters.\n// '\\': Escape character used to include special characters,\n//      e.g. '_', '%', '\\'. If a '\\' precedes a non-special\n//      character it has no special meaning and is interpreted\n//      literally.\ntypedef string TPattern\n\n\n// A search pattern or identifier. Used as input\n// parameter for many of the catalog functions.\ntypedef string TPatternOrIdentifier\n\nstruct THandleIdentifier {\n  // 16 byte globally unique identifier\n  // This is the public ID of the handle and\n  // can be used for reporting.\n  1: required binary guid,\n\n  // 16 byte secret generated by the server\n  // and used to verify that the handle is not\n  // being hijacked by another user.\n  2: required binary secret,\n}\n\n// Client-side handle to persistent\n// session information on the server-side.\nstruct TSessionHandle {\n  1: required THandleIdentifier sessionId\n}\n\n// The subtype of an OperationHandle.\nenum TOperationType {\n  EXECUTE_STATEMENT,\n  GET_TYPE_INFO,\n  GET_CATALOGS,\n  GET_SCHEMAS,\n  GET_TABLES,\n  GET_TABLE_TYPES,\n  GET_COLUMNS,\n  GET_FUNCTIONS,\n  UNKNOWN,\n}\n\n// Client-side reference to a task running\n// asynchronously on the server.\nstruct TOperationHandle {\n  1: required THandleIdentifier operationId\n  2: required TOperationType operationType\n\n  // If hasResultSet = TRUE, then this operation\n  // generates a result set that can be fetched.\n  // Note that the result set may be empty.\n  //\n  // If hasResultSet = FALSE, then this operation\n  // does not generate a result set, and calling\n  // GetResultSetMetadata or FetchResults against\n  // this OperationHandle will generate an error.\n  3: required bool hasResultSet\n\n  // For operations that don't generate result sets,\n  // modifiedRowCount is either:\n  //\n  // 1) The number of rows that were modified by\n  //    the DML operation (e.g. number of rows inserted,\n  //    number of rows deleted, etc).\n  //\n  // 2) 0 for operations that don't modify or add rows.\n  //\n  // 3) < 0 if the operation is capable of modifiying rows,\n  //    but Hive is unable to determine how many rows were\n  //    modified. For example, Hive's LOAD DATA command\n  //    doesn't generate row count information because\n  //    Hive doesn't inspect the data as it is loaded.\n  //\n  // modifiedRowCount is unset if the operation generates\n  // a result set.\n  4: optional double modifiedRowCount\n}\n\n\n// OpenSession()\n//\n// Open a session (connection) on the server against\n// which operations may be executed. \nstruct TOpenSessionReq {\n  // The version of the HiveServer2 protocol that the client is using.\n  1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1\n  \n  // Username and password for authentication.\n  // Depending on the authentication scheme being used,\n  // this information may instead be provided by a lower\n  // protocol layer, in which case these fields may be\n  // left unset.\n  2: optional string username\n  3: optional string password\n\n  // Configuration overlay which is applied when the session is\n  // first created.\n  4: optional map<string, string> configuration\n}\n\nstruct TOpenSessionResp {\n  1: required TStatus status\n\n  // The protocol version that the server is using.\n  2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1\n\n  // Session Handle\n  3: optional TSessionHandle sessionHandle\n\n  // The configuration settings for this session.\n  4: optional map<string, string> configuration\n}\n\n\n// CloseSession()\n//\n// Closes the specified session and frees any resources\n// currently allocated to that session. Any open\n// operations in that session will be canceled.\nstruct TCloseSessionReq {\n  1: required TSessionHandle sessionHandle\n}\n\nstruct TCloseSessionResp {\n  1: required TStatus status\n}\n\n\n\nenum TGetInfoType {\n  CLI_MAX_DRIVER_CONNECTIONS =           0,\n  CLI_MAX_CONCURRENT_ACTIVITIES =        1,\n  CLI_DATA_SOURCE_NAME =                 2,\n  CLI_FETCH_DIRECTION =                  8,\n  CLI_SERVER_NAME =                      13,\n  CLI_SEARCH_PATTERN_ESCAPE =            14,\n  CLI_DBMS_NAME =                        17,\n  CLI_DBMS_VER =                         18,\n  CLI_ACCESSIBLE_TABLES =                19,\n  CLI_ACCESSIBLE_PROCEDURES =            20,\n  CLI_CURSOR_COMMIT_BEHAVIOR =           23,\n  CLI_DATA_SOURCE_READ_ONLY =            25,\n  CLI_DEFAULT_TXN_ISOLATION =            26,\n  CLI_IDENTIFIER_CASE =                  28,\n  CLI_IDENTIFIER_QUOTE_CHAR =            29,\n  CLI_MAX_COLUMN_NAME_LEN =              30,\n  CLI_MAX_CURSOR_NAME_LEN =              31,\n  CLI_MAX_SCHEMA_NAME_LEN =              32,\n  CLI_MAX_CATALOG_NAME_LEN =             34,\n  CLI_MAX_TABLE_NAME_LEN =               35,\n  CLI_SCROLL_CONCURRENCY =               43,\n  CLI_TXN_CAPABLE =                      46,\n  CLI_USER_NAME =                        47,\n  CLI_TXN_ISOLATION_OPTION =             72,\n  CLI_INTEGRITY =                        73,\n  CLI_GETDATA_EXTENSIONS =               81,\n  CLI_NULL_COLLATION =                   85,\n  CLI_ALTER_TABLE =                      86,\n  CLI_ORDER_BY_COLUMNS_IN_SELECT =       90,\n  CLI_SPECIAL_CHARACTERS =               94,\n  CLI_MAX_COLUMNS_IN_GROUP_BY =          97,\n  CLI_MAX_COLUMNS_IN_INDEX =             98,\n  CLI_MAX_COLUMNS_IN_ORDER_BY =          99,\n  CLI_MAX_COLUMNS_IN_SELECT =            100,\n  CLI_MAX_COLUMNS_IN_TABLE =             101,\n  CLI_MAX_INDEX_SIZE =                   102,\n  CLI_MAX_ROW_SIZE =                     104,\n  CLI_MAX_STATEMENT_LEN =                105,\n  CLI_MAX_TABLES_IN_SELECT =             106,\n  CLI_MAX_USER_NAME_LEN =                107,\n  CLI_OJ_CAPABILITIES =                  115,\n\n  CLI_XOPEN_CLI_YEAR =                   10000,\n  CLI_CURSOR_SENSITIVITY =               10001,\n  CLI_DESCRIBE_PARAMETER =               10002,\n  CLI_CATALOG_NAME =                     10003,\n  CLI_COLLATION_SEQ =                    10004,\n  CLI_MAX_IDENTIFIER_LEN =               10005,\n}\n\nunion TGetInfoValue {\n  1: string stringValue\n  2: i16 smallIntValue\n  3: i32 integerBitmask\n  4: i32 integerFlag\n  5: i32 binaryValue\n  6: i64 lenValue\n}\n\n// GetInfo()\n//\n// This function is based on ODBC's CLIGetInfo() function.\n// The function returns general information about the data source\n// using the same keys as ODBC.\nstruct TGetInfoReq {\n  // The sesssion to run this request against\n  1: required TSessionHandle sessionHandle\n\n  2: required TGetInfoType infoType\n}\n\nstruct TGetInfoResp {\n  1: required TStatus status\n\n  2: required TGetInfoValue infoValue\n}\n\n\n// ExecuteStatement()\n//\n// Execute a statement.\n// The returned OperationHandle can be used to check on the\n// status of the statement, and to fetch results once the\n// statement has finished executing.\nstruct TExecuteStatementReq {\n  // The session to exexcute the statement against\n  1: required TSessionHandle sessionHandle\n\n  // The statement to be executed (DML, DDL, SET, etc)\n  2: required string statement\n\n  // Configuration properties that are overlayed on top of the\n  // the existing session configuration before this statement\n  // is executed. These properties apply to this statement\n  // only and will not affect the subsequent state of the Session.\n  3: optional map<string, string> confOverlay\n}\n\nstruct TExecuteStatementResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetTypeInfo()\n//\n// Get information about types supported by the HiveServer instance.\n// The information is returned as a result set which can be fetched\n// using the OperationHandle provided in the response.\n//\n// Refer to the documentation for ODBC's CLIGetTypeInfo function for\n// the format of the result set.\nstruct TGetTypeInfoReq {\n  // The session to run this request against.\n  1: required TSessionHandle sessionHandle\n}\n\nstruct TGetTypeInfoResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}  \n\n\n// GetCatalogs()\n//\n// Returns the list of catalogs (databases) \n// Results are ordered by TABLE_CATALOG \n//\n// Resultset columns :\n// col1\n// name: TABLE_CAT\n// type: STRING\n// desc: Catalog name. NULL if not applicable.\n//\nstruct TGetCatalogsReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n}\n\nstruct TGetCatalogsResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetSchemas()\n//\n// Retrieves the schema names available in this database. \n// The results are ordered by TABLE_CATALOG and TABLE_SCHEM.\n// col1\n// name: TABLE_SCHEM\n// type: STRING\n// desc: schema name\n// col2\n// name: TABLE_CATALOG\n// type: STRING\n// desc: catalog name\nstruct TGetSchemasReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n\n  // Name of the catalog. Must not contain a search pattern.\n  2: optional TIdentifier catalogName\n\n  // schema name or pattern\n  3: optional TPatternOrIdentifier schemaName\n}\n\nstruct TGetSchemasResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetTables()\n//\n// Returns a list of tables with catalog, schema, and table\n// type information. The information is returned as a result\n// set which can be fetched using the OperationHandle\n// provided in the response.\n// Results are ordered by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, and TABLE_NAME\n//\n// Result Set Columns:\n//\n// col1\n// name: TABLE_CAT\n// type: STRING\n// desc: Catalog name. NULL if not applicable.\n//\n// col2\n// name: TABLE_SCHEM\n// type: STRING\n// desc: Schema name.\n//\n// col3\n// name: TABLE_NAME\n// type: STRING\n// desc: Table name.\n//\n// col4\n// name: TABLE_TYPE\n// type: STRING\n// desc: The table type, e.g. \"TABLE\", \"VIEW\", etc.\n//\n// col5\n// name: REMARKS\n// type: STRING\n// desc: Comments about the table\n//\nstruct TGetTablesReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n\n  // Name of the catalog or a search pattern.\n  2: optional TPatternOrIdentifier catalogName\n\n  // Name of the schema or a search pattern.\n  3: optional TPatternOrIdentifier schemaName\n\n  // Name of the table or a search pattern.\n  4: optional TPatternOrIdentifier tableName\n\n  // List of table types to match\n  // e.g. \"TABLE\", \"VIEW\", \"SYSTEM TABLE\", \"GLOBAL TEMPORARY\",\n  // \"LOCAL TEMPORARY\", \"ALIAS\", \"SYNONYM\", etc.\n  5: optional list<string> tableTypes\n}\n\nstruct TGetTablesResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetTableTypes()\n//\n// Returns the table types available in this database. \n// The results are ordered by table type. \n// \n// col1\n// name: TABLE_TYPE\n// type: STRING\n// desc: Table type name.\nstruct TGetTableTypesReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n}\n\nstruct TGetTableTypesResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetColumns()\n//\n// Returns a list of columns in the specified tables.\n// The information is returned as a result set which can be fetched\n// using the OperationHandle provided in the response.\n// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, \n// and ORDINAL_POSITION. \n//\n// Result Set Columns are the same as those for the ODBC CLIColumns\n// function.\n//\nstruct TGetColumnsReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n\n  // Name of the catalog. Must not contain a search pattern.\n  2: optional TIdentifier catalogName\n\n  // Schema name or search pattern\n  3: optional TPatternOrIdentifier schemaName\n\n  // Table name or search pattern\n  4: optional TPatternOrIdentifier tableName\n\n  // Column name or search pattern\n  5: optional TPatternOrIdentifier columnName\n}\n\nstruct TGetColumnsResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n\n\n// GetFunctions()\n//\n// Returns a list of functions supported by the data source. The\n// behavior of this function matches\n// java.sql.DatabaseMetaData.getFunctions() both in terms of\n// inputs and outputs.\n//\n// Result Set Columns:\n//\n// col1\n// name: FUNCTION_CAT\n// type: STRING\n// desc: Function catalog (may be null)\n//\n// col2\n// name: FUNCTION_SCHEM\n// type: STRING\n// desc: Function schema (may be null)\n//\n// col3\n// name: FUNCTION_NAME\n// type: STRING\n// desc: Function name. This is the name used to invoke the function.\n//\n// col4\n// name: REMARKS\n// type: STRING\n// desc: Explanatory comment on the function.\n//\n// col5\n// name: FUNCTION_TYPE\n// type: SMALLINT\n// desc: Kind of function. One of:\n//       * functionResultUnknown - Cannot determine if a return value or a table\n//                                 will be returned.\n//       * functionNoTable       - Does not a return a table.\n//       * functionReturnsTable  - Returns a table.\n//\n// col6\n// name: SPECIFIC_NAME\n// type: STRING\n// desc: The name which uniquely identifies this function within its schema.\n//       In this case this is the fully qualified class name of the class\n//       that implements this function.\n//\nstruct TGetFunctionsReq {\n  // Session to run this request against\n  1: required TSessionHandle sessionHandle\n\n  // A catalog name; must match the catalog name as it is stored in the\n  // database; \"\" retrieves those without a catalog; null means\n  // that the catalog name should not be used to narrow the search.\n  2: optional TIdentifier catalogName\n\n  // A schema name pattern; must match the schema name as it is stored\n  // in the database; \"\" retrieves those without a schema; null means\n  // that the schema name should not be used to narrow the search.\n  3: optional TPatternOrIdentifier schemaName\n\n  // A function name pattern; must match the function name as it is stored\n  // in the database.\n  4: required TPatternOrIdentifier functionName\n}\n\nstruct TGetFunctionsResp {\n  1: required TStatus status\n  2: optional TOperationHandle operationHandle\n}\n  \n\n// GetOperationStatus()\n//\n// Get the status of an operation running on the server.\nstruct TGetOperationStatusReq {\n  // Session to run this request against\n  1: required TOperationHandle operationHandle\n}\n\nstruct TGetOperationStatusResp {\n  1: required TStatus status\n  2: optional TOperationState operationState\n}\n\n\n// CancelOperation()\n//\n// Cancels processing on the specified operation handle and\n// frees any resources which were allocated.\nstruct TCancelOperationReq {\n  // Operation to cancel\n  1: required TOperationHandle operationHandle\n}\n\nstruct TCancelOperationResp {\n  1: required TStatus status\n}\n\n\n// CloseOperation()\n//\n// Given an operation in the FINISHED, CANCELED,\n// or ERROR states, CloseOperation() will free\n// all of the resources which were allocated on\n// the server to service the operation.\nstruct TCloseOperationReq {\n  1: required TOperationHandle operationHandle\n}\n\nstruct TCloseOperationResp {\n  1: required TStatus status\n}\n\n\n// GetResultSetMetadata()\n//\n// Retrieves schema information for the specified operation\nstruct TGetResultSetMetadataReq {\n  // Operation for which to fetch result set schema information\n  1: required TOperationHandle operationHandle\n}\n\nstruct TGetResultSetMetadataResp {\n  1: required TStatus status\n  2: optional TTableSchema schema\n}\n\n\nenum TFetchOrientation {\n  // Get the next rowset. The fetch offset is ignored.\n  FETCH_NEXT,\n\n  // Get the previous rowset. The fetch offset is ignored.\n  // NOT SUPPORTED\n  FETCH_PRIOR,\n\n  // Return the rowset at the given fetch offset relative\n  // to the curren rowset.\n  // NOT SUPPORTED\n  FETCH_RELATIVE,\n\n  // Return the rowset at the specified fetch offset.\n  // NOT SUPPORTED\n  FETCH_ABSOLUTE,\n\n  // Get the first rowset in the result set.\n  FETCH_FIRST,\n\n  // Get the last rowset in the result set.\n  // NOT SUPPORTED\n  FETCH_LAST\n}\n\n// FetchResults()\n//\n// Fetch rows from the server corresponding to\n// a particular OperationHandle.\nstruct TFetchResultsReq {\n  // Operation from which to fetch results.\n  1: required TOperationHandle operationHandle\n\n  // The fetch orientation. For V1 this must be either\n  // FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT.\n  2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT\n  \n  // Max number of rows that should be returned in\n  // the rowset.\n  3: required i64 maxRows\n}\n\nstruct TFetchResultsResp {\n  1: required TStatus status\n\n  // TRUE if there are more rows left to fetch from the server.\n  2: optional bool hasMoreRows\n\n  // The rowset. This is optional so that we have the\n  // option in the future of adding alternate formats for\n  // representing result set data, e.g. delimited strings,\n  // binary encoded, etc.\n  3: optional TRowSet results\n}\n\nservice TCLIService {\n\n  TOpenSessionResp OpenSession(1:TOpenSessionReq req);\n\n  TCloseSessionResp CloseSession(1:TCloseSessionReq req);\n\n  TGetInfoResp GetInfo(1:TGetInfoReq req);\n\n  TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req);\n\n  TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req);\n\n  TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req);\n\n  TGetSchemasResp GetSchemas(1:TGetSchemasReq req);\n\n  TGetTablesResp GetTables(1:TGetTablesReq req);\n\n  TGetTableTypesResp GetTableTypes(1:TGetTableTypesReq req);\n\n  TGetColumnsResp GetColumns(1:TGetColumnsReq req);\n\n  TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req);\n\n  TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req);\n  \n  TCancelOperationResp CancelOperation(1:TCancelOperationReq req);\n\n  TCloseOperationResp CloseOperation(1:TCloseOperationReq req);\n\n  TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req);\n  \n  TFetchResultsResp FetchResults(1:TFetchResultsReq req);\n}\n"
  },
  {
    "path": "src/hiveserver/if/hive_service.thrift",
    "content": "#!/usr/local/bin/thrift -java\n\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#\n# Thrift Service that the hive service is built on\n#\n\n#\n# TODO: include/thrift is shared among different components. It\n# should not be under metastore.\n\ninclude \"share/fb303/if/fb303.thrift\"\ninclude \"metastore/if/hive_metastore.thrift\"\ninclude \"ql/if/queryplan.thrift\"\n\nnamespace java org.apache.hadoop.hive.service\nnamespace cpp Apache.Hadoop.Hive\n\n// Enumeration of JobTracker.State                                                                      \nenum JobTrackerState {                                                                   \n  INITIALIZING   = 1,           \n  RUNNING        = 2,                                                      \n}  \n\n// Map-Reduce cluster status information\nstruct HiveClusterStatus {\n  1: i32              taskTrackers,\n  2: i32              mapTasks,\n  3: i32              reduceTasks,\n  4: i32              maxMapTasks,\n  5: i32              maxReduceTasks,\n  6: JobTrackerState  state,\n}\n\nexception HiveServerException {\n  1: string message\n  2: i32 errorCode\n  3: string SQLState\n}\n\n# Interface for Thrift Hive Server\nservice ThriftHive extends hive_metastore.ThriftHiveMetastore {\n  # Execute a query. Takes a HiveQL string\n  void execute(1:string query) throws(1:HiveServerException ex)\n\n  # Fetch one row. This row is the serialized form\n  # of the result of the query\n  string fetchOne() throws(1:HiveServerException ex)\n\n  # Fetch a given number of rows or remaining number of\n  # rows whichever is smaller.\n  list<string> fetchN(1:i32 numRows) throws(1:HiveServerException ex)\n\n  # Fetch all rows of the query result\n  list<string> fetchAll() throws(1:HiveServerException ex)\n\n  # Get a schema object with fields represented with native Hive types\n  hive_metastore.Schema getSchema() throws(1:HiveServerException ex)\n\n  # Get a schema object with fields represented with Thrift DDL types\n  hive_metastore.Schema getThriftSchema() throws(1:HiveServerException ex)\n  \n  # Get the status information about the Map-Reduce cluster\n  HiveClusterStatus getClusterStatus() throws(1:HiveServerException ex)\n  \n  # Get the queryplan annotated with counter information\n  queryplan.QueryPlan getQueryPlan() throws(1:HiveServerException ex)\n\n  # clean up last Hive query (releasing locks etc.)\n  void clean()\n}\n"
  },
  {
    "path": "src/hiveserver/if/metastore/if/hive_metastore.thrift",
    "content": "#!/usr/local/bin/thrift -java\n#\n# Thrift Service that the MetaStore is built on\n#\n\ninclude \"share/fb303/if/fb303.thrift\"\n\nnamespace java org.apache.hadoop.hive.metastore.api\nnamespace php metastore\nnamespace cpp Apache.Hadoop.Hive\n\nconst string DDL_TIME = \"transient_lastDdlTime\"\n\nstruct Version {\n  1: string version,\n  2: string comments\n}\n\nstruct FieldSchema {\n  1: string name, // name of the field\n  2: string type, // type of the field. primitive types defined above, specify list<TYPE_NAME>, map<TYPE_NAME, TYPE_NAME> for lists & maps\n  3: string comment\n}\n\nstruct Type {\n  1: string          name,             // one of the types in PrimitiveTypes or CollectionTypes or User defined types\n  2: optional string type1,            // object type if the name is 'list' (LIST_TYPE), key type if the name is 'map' (MAP_TYPE)\n  3: optional string type2,            // val type if the name is 'map' (MAP_TYPE)\n  4: optional list<FieldSchema> fields // if the name is one of the user defined types\n}\n\nenum HiveObjectType {\n  GLOBAL = 1,\n  DATABASE = 2,\n  TABLE = 3,\n  PARTITION = 4,\n  COLUMN = 5,\n}\n\nenum PrincipalType {\n  USER = 1,\n  ROLE = 2,\n  GROUP = 3,\n}\n\nstruct HiveObjectRef{\n  1: HiveObjectType objectType,\n  2: string dbName,\n  3: string objectName,\n  4: list<string> partValues,\n  5: string columnName,\n}\n\nstruct PrivilegeGrantInfo {\n  1: string privilege,\n  2: i32 createTime,\n  3: string grantor,\n  4: PrincipalType grantorType,\n  5: bool grantOption,\n}\n\nstruct HiveObjectPrivilege {\n  1: HiveObjectRef  hiveObject,\n  2: string principalName,\n  3: PrincipalType principalType,\n  4: PrivilegeGrantInfo grantInfo,\n}\n\nstruct PrivilegeBag {\n  1: list<HiveObjectPrivilege> privileges,\n}\n\nstruct PrincipalPrivilegeSet {\n  1: map<string, list<PrivilegeGrantInfo>> userPrivileges, // user name -> privilege grant info\n  2: map<string, list<PrivilegeGrantInfo>> groupPrivileges, // group name -> privilege grant info\n  3: map<string, list<PrivilegeGrantInfo>> rolePrivileges, //role name -> privilege grant info\n}\n\nstruct Role {\n  1: string roleName,\n  2: i32 createTime,\n  3: string ownerName,\n}\n\n// namespace for tables\nstruct Database {\n  1: string name,\n  2: string description,\n  3: string locationUri,\n  4: map<string, string> parameters, // properties associated with the database\n  5: optional PrincipalPrivilegeSet privileges\n}\n\n// This object holds the information needed by SerDes\nstruct SerDeInfo {\n  1: string name,                   // name of the serde, table name by default\n  2: string serializationLib,       // usually the class that implements the extractor & loader\n  3: map<string, string> parameters // initialization parameters\n}\n\n// sort order of a column (column name along with asc(1)/desc(0))\nstruct Order {\n  1: string col,  // sort column name\n  2: i32    order // asc(1) or desc(0)\n}\n\n// this object holds all the information about physical storage of the data belonging to a table\nstruct StorageDescriptor {\n  1: list<FieldSchema> cols,  // required (refer to types defined above)\n  2: string location,         // defaults to <warehouse loc>/<db loc>/tablename\n  3: string inputFormat,      // SequenceFileInputFormat (binary) or TextInputFormat`  or custom format\n  4: string outputFormat,     // SequenceFileOutputFormat (binary) or IgnoreKeyTextOutputFormat or custom format\n  5: bool   compressed,       // compressed or not\n  6: i32    numBuckets,       // this must be specified if there are any dimension columns\n  7: SerDeInfo    serdeInfo,  // serialization and deserialization information\n  8: list<string> bucketCols, // reducer grouping columns and clustering columns and bucketing columns`\n  9: list<Order>  sortCols,   // sort order of the data in each bucket\n  10: map<string, string> parameters // any user supplied key value hash\n}\n\n// table information\nstruct Table {\n  1: string tableName,                // name of the table\n  2: string dbName,                   // database name ('default')\n  3: string owner,                    // owner of this table\n  4: i32    createTime,               // creation time of the table\n  5: i32    lastAccessTime,           // last access time (usually this will be filled from HDFS and shouldn't be relied on)\n  6: i32    retention,                // retention time\n  7: StorageDescriptor sd,            // storage descriptor of the table\n  8: list<FieldSchema> partitionKeys, // partition keys of the table. only primitive types are supported\n  9: map<string, string> parameters,   // to store comments or any other user level parameters\n  10: string viewOriginalText,         // original view text, null for non-view\n  11: string viewExpandedText,         // expanded view text, null for non-view\n  12: string tableType,                 // table type enum, e.g. EXTERNAL_TABLE\n  13: optional PrincipalPrivilegeSet privileges,\n}\n\nstruct Partition {\n  1: list<string> values // string value is converted to appropriate partition key type\n  2: string       dbName,\n  3: string       tableName,\n  4: i32          createTime,\n  5: i32          lastAccessTime,\n  6: StorageDescriptor   sd,\n  7: map<string, string> parameters,\n  8: optional PrincipalPrivilegeSet privileges\n}\n\nstruct Index {\n  1: string       indexName, // unique with in the whole database namespace\n  2: string       indexHandlerClass, // reserved\n  3: string       dbName,\n  4: string       origTableName,\n  5: i32          createTime,\n  6: i32          lastAccessTime,\n  7: string       indexTableName,\n  8: StorageDescriptor   sd,\n  9: map<string, string> parameters,\n  10: bool         deferredRebuild\n}\n\n// schema of the table/query results etc.\nstruct Schema {\n // column names, types, comments\n 1: list<FieldSchema> fieldSchemas,  // delimiters etc\n 2: map<string, string> properties\n}\n\nexception MetaException {\n  1: string message\n}\n\nexception UnknownTableException {\n  1: string message\n}\n\nexception UnknownDBException {\n  1: string message\n}\n\nexception AlreadyExistsException {\n  1: string message\n}\n\nexception InvalidObjectException {\n  1: string message\n}\n\nexception NoSuchObjectException {\n  1: string message\n}\n\nexception IndexAlreadyExistsException {\n  1: string message\n}\n\nexception InvalidOperationException {\n  1: string message\n}\n\nexception ConfigValSecurityException {\n  1: string message\n}\n\n/**\n* This interface is live.\n*/\nservice ThriftHiveMetastore extends fb303.FacebookService\n{\n  void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)\n  Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2)\n  void drop_database(1:string name, 2:bool deleteData) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3)\n  list<string> get_databases(1:string pattern) throws(1:MetaException o1)\n  list<string> get_all_databases() throws(1:MetaException o1)\n  void alter_database(1:string dbname, 2:Database db) throws(1:MetaException o1, 2:NoSuchObjectException o2)\n  \n  // returns the type with given name (make seperate calls for the dependent types if needed)\n  Type get_type(1:string name)  throws(1:MetaException o1, 2:NoSuchObjectException o2)\n  bool create_type(1:Type type) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)\n  bool drop_type(1:string type) throws(1:MetaException o1, 2:NoSuchObjectException o2)\n  map<string, Type> get_type_all(1:string name)\n                                throws(1:MetaException o2)\n\n  // Gets a list of FieldSchemas describing the columns of a particular table\n  list<FieldSchema> get_fields(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3),\n\n  // Gets a list of FieldSchemas describing both the columns and the partition keys of a particular table\n  list<FieldSchema> get_schema(1: string db_name, 2: string table_name) throws (1: MetaException o1, 2: UnknownTableException o2, 3: UnknownDBException o3)\n\n  // create a Hive table. Following fields must be set\n  // tableName\n  // database        (only 'default' for now until Hive QL supports databases)\n  // owner           (not needed, but good to have for tracking purposes)\n  // sd.cols         (list of field schemas)\n  // sd.inputFormat  (SequenceFileInputFormat (binary like falcon tables or u_full) or TextInputFormat)\n  // sd.outputFormat (SequenceFileInputFormat (binary) or TextInputFormat)\n  // sd.serdeInfo.serializationLib (SerDe class name eg org.apache.hadoop.hive.serde.simple_meta.MetadataTypedColumnsetSerDe\n  // * See notes on DDL_TIME\n  void create_table(1:Table tbl) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3, 4:NoSuchObjectException o4)\n  // drops the table and all the partitions associated with it if the table has partitions\n  // delete data (including partitions) if deleteData is set to true\n  void drop_table(1:string dbname, 2:string name, 3:bool deleteData)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o3)\n  list<string> get_tables(1: string db_name, 2: string pattern) throws (1: MetaException o1)\n  list<string> get_all_tables(1: string db_name) throws (1: MetaException o1)\n\n  Table get_table(1:string dbname, 2:string tbl_name)\n                       throws (1:MetaException o1, 2:NoSuchObjectException o2)\n  // alter table applies to only future partitions not for existing partitions\n  // * See notes on DDL_TIME\n  void alter_table(1:string dbname, 2:string tbl_name, 3:Table new_tbl)\n                       throws (1:InvalidOperationException o1, 2:MetaException o2)\n\n  // the following applies to only tables that have partitions\n  // * See notes on DDL_TIME\n  Partition add_partition(1:Partition new_part)\n                       throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)\n  Partition append_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals)\n                       throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)\n  Partition append_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name)\n                       throws (1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)\n  bool drop_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 4:bool deleteData)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o2)\n  bool drop_partition_by_name(1:string db_name, 2:string tbl_name, 3:string part_name, 4:bool deleteData)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o2) \n  Partition get_partition(1:string db_name, 2:string tbl_name, 3:list<string> part_vals)\n                       throws(1:MetaException o1, 2:NoSuchObjectException o2)\n\n  Partition get_partition_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, \n      4: string user_name, 5: list<string> group_names) throws(1:MetaException o1, 2:NoSuchObjectException o2)\n\n  Partition get_partition_by_name(1:string db_name 2:string tbl_name, 3:string part_name)\n                       throws(1:MetaException o1, 2:NoSuchObjectException o2)\n\n  // returns all the partitions for this table in reverse chronological order.\n  // If max parts is given then it will return only that many.\n  list<Partition> get_partitions(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o2)\n  list<Partition> get_partitions_with_auth(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1, \n     4: string user_name, 5: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)                       \n\n  list<string> get_partition_names(1:string db_name, 2:string tbl_name, 3:i16 max_parts=-1)\n                       throws(1:MetaException o2)\n                       \n  // get_partition*_ps methods allow filtering by a partial partition specification, \n  // as needed for dynamic partitions. The values that are not restricted should \n  // be empty strings. Nulls were considered (instead of \"\") but caused errors in \n  // generated Python code. The size of part_vals may be smaller than the\n  // number of partition columns - the unspecified values are considered the same\n  // as \"\".\n  list<Partition> get_partitions_ps(1:string db_name 2:string tbl_name \n  \t3:list<string> part_vals, 4:i16 max_parts=-1)\n                       throws(1:MetaException o1)\n  list<Partition> get_partitions_ps_with_auth(1:string db_name, 2:string tbl_name, 3:list<string> part_vals, 4:i16 max_parts=-1, \n     5: string user_name, 6: list<string> group_names) throws(1:NoSuchObjectException o1, 2:MetaException o2)                       \n  \n  list<string> get_partition_names_ps(1:string db_name, \n  \t2:string tbl_name, 3:list<string> part_vals, 4:i16 max_parts=-1)\n  \t                   throws(1:MetaException o1)\n\n  // get the partitions matching the given partition filter\n  list<Partition> get_partitions_by_filter(1:string db_name 2:string tbl_name\n    3:string filter, 4:i16 max_parts=-1)\n                       throws(1:MetaException o1, 2:NoSuchObjectException o2)\n\n  // changes the partition to the new partition object. partition is identified from the part values\n  // in the new_part\n  // * See notes on DDL_TIME\n  void alter_partition(1:string db_name, 2:string tbl_name, 3:Partition new_part)\n                       throws(1:InvalidOperationException o1, 2:MetaException o2)\n\n  // gets the value of the configuration key in the metastore server. returns\n  // defaultValue if the key does not exist. if the configuration key does not\n  // begin with \"hive\", \"mapred\", or \"hdfs\", a ConfigValSecurityException is\n  // thrown.\n  string get_config_value(1:string name, 2:string defaultValue)\n                          throws(1:ConfigValSecurityException o1)\n                          \n  // converts a partition name into a partition values array\n  list<string> partition_name_to_vals(1: string part_name)\n                          throws(1: MetaException o1)\n  // converts a partition name into a partition specification (a mapping from\n  // the partition cols to the values)\n  map<string, string> partition_name_to_spec(1: string part_name)\n                          throws(1: MetaException o1)\n  \n  //index\n  Index add_index(1:Index new_index, 2: Table index_table)\n                       throws(1:InvalidObjectException o1, 2:AlreadyExistsException o2, 3:MetaException o3)\n  void alter_index(1:string dbname, 2:string base_tbl_name, 3:string idx_name, 4:Index new_idx)\n                       throws (1:InvalidOperationException o1, 2:MetaException o2)\n  bool drop_index_by_name(1:string db_name, 2:string tbl_name, 3:string index_name, 4:bool deleteData)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o2) \n  Index get_index_by_name(1:string db_name 2:string tbl_name, 3:string index_name)\n                       throws(1:MetaException o1, 2:NoSuchObjectException o2)\n\n  list<Index> get_indexes(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)\n                       throws(1:NoSuchObjectException o1, 2:MetaException o2)\n  list<string> get_index_names(1:string db_name, 2:string tbl_name, 3:i16 max_indexes=-1)\n                       throws(1:MetaException o2)\n\n  //authorization privileges\n                       \n  bool create_role(1:Role role) throws(1:MetaException o1)\n  bool drop_role(1:string role_name) throws(1:MetaException o1)\n  list<string> get_role_names() throws(1:MetaException o1)\n  bool grant_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type, \n    4:string grantor, 5:PrincipalType grantorType, 6:bool grant_option) throws(1:MetaException o1)\n  bool revoke_role(1:string role_name, 2:string principal_name, 3:PrincipalType principal_type) \n                        throws(1:MetaException o1)\n  list<Role> list_roles(1:string principal_name, 2:PrincipalType principal_type) throws(1:MetaException o1)\n\n  PrincipalPrivilegeSet get_privilege_set(1:HiveObjectRef hiveObject, 2:string user_name, \n    3: list<string> group_names) throws(1:MetaException o1)\n  list<HiveObjectPrivilege> list_privileges(1:string principal_name, 2:PrincipalType principal_type, \n    3: HiveObjectRef hiveObject) throws(1:MetaException o1)\n  \n  bool grant_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)\n  bool revoke_privileges(1:PrivilegeBag privileges) throws(1:MetaException o1)\n  \n  //Authentication (delegation token) interfaces\n  \n  // get metastore server delegation token for use from the map/reduce tasks to authenticate\n  // to metastore server\n  string get_delegation_token(1:string renewer_kerberos_principal_name) throws (1:MetaException o1)\n\n  // get metastore server delegation token for use from the map/reduce tasks to authenticate\n  // to metastore server - this method takes an extra token signature string which is just\n  // an identifier to associate with the token - this will be used by the token selector code\n  // to pick the right token given the associated identifier.\n  string get_delegation_token_with_signature(1:string renewer_kerberos_principal_name, \n    2:string token_signature) throws (1:MetaException o1)\n\n  // method to renew delegation token obtained from metastore server\n  i64 renew_delegation_token(1:string token_str_form) throws (1:MetaException o1)\n\n  // method to cancel delegation token obtained from metastore server\n  void cancel_delegation_token(1:string token_str_form) throws (1:MetaException o1)\n}\n\n// * Note about the DDL_TIME: When creating or altering a table or a partition,\n// if the DDL_TIME is not set, the current time will be used.\n\n// For storing info about archived partitions in parameters\n\n// Whether the partition is archived\nconst string IS_ARCHIVED = \"is_archived\",\n// The original location of the partition, before archiving. After archiving,\n// this directory will contain the archive. When the partition\n// is dropped, this directory will be deleted\nconst string ORIGINAL_LOCATION = \"original_location\",\n\n// these should be needed only for backward compatibility with filestore\nconst string META_TABLE_COLUMNS   = \"columns\",\nconst string META_TABLE_COLUMN_TYPES   = \"columns.types\",\nconst string BUCKET_FIELD_NAME    = \"bucket_field_name\",\nconst string BUCKET_COUNT         = \"bucket_count\",\nconst string FIELD_TO_DIMENSION   = \"field_to_dimension\",\nconst string META_TABLE_NAME      = \"name\",\nconst string META_TABLE_DB        = \"db\",\nconst string META_TABLE_LOCATION  = \"location\",\nconst string META_TABLE_SERDE     = \"serde\",\nconst string META_TABLE_PARTITION_COLUMNS = \"partition_columns\",\nconst string FILE_INPUT_FORMAT    = \"file.inputformat\",\nconst string FILE_OUTPUT_FORMAT   = \"file.outputformat\",\nconst string META_TABLE_STORAGE   = \"storage_handler\",\n\n\n\n"
  },
  {
    "path": "src/hiveserver/if/ql/if/queryplan.thrift",
    "content": "namespace java org.apache.hadoop.hive.ql.plan.api\nnamespace cpp Apache.Hadoop.Hive\n\nenum AdjacencyType { CONJUNCTIVE, DISJUNCTIVE }\nstruct Adjacency {\n1: string node,\n2: list<string> children,\n3: AdjacencyType adjacencyType,\n}\n\nenum NodeType { OPERATOR, STAGE }\nstruct Graph {\n1: NodeType nodeType,\n2: list<string> roots,\n3: list<Adjacency> adjacencyList,\n}\n\n#Represents a operator along with its counters\nenum OperatorType {\n  JOIN,\n  MAPJOIN,\n  EXTRACT,\n  FILTER,\n  FORWARD,\n  GROUPBY,\n  LIMIT,\n  SCRIPT,\n  SELECT,\n  TABLESCAN,\n  FILESINK,\n  REDUCESINK,\n  UNION,\n  UDTF,\n  LATERALVIEWJOIN,\n  LATERALVIEWFORWARD,\n  HASHTABLESINK,\n  HASHTABLEDUMMY,\n}\n\nstruct Operator {\n1: string operatorId,\n2: OperatorType operatorType,\n3: map<string, string> operatorAttributes,\n4: map<string, i64> operatorCounters,\n5: bool done,\n6: bool started,\n}\n\n# Represents whether it is a map-reduce job or not. In future, different tasks can add their dependencies\n# The operator graph shows the operator tree\nenum TaskType { MAP, REDUCE, OTHER }\nstruct Task {\n1: string taskId,\n2: TaskType taskType\n3: map<string, string> taskAttributes,\n4: map<string, i64> taskCounters,\n5: optional Graph operatorGraph,\n6: optional list<Operator> operatorList,\n7: bool done,\n8: bool started,\n}\n\n# Represents a Stage - unfortunately, it is represented as Task in ql/exec\nenum StageType {\n  CONDITIONAL,\n  COPY,\n  DDL,\n  MAPRED,\n  EXPLAIN,\n  FETCH,\n  FUNC,\n  MAPREDLOCAL,\n  MOVE,\n  STATS,\n}\n\nstruct Stage {\n1: string stageId,\n2: StageType stageType,\n3: map<string, string> stageAttributes,\n4: map<string, i64> stageCounters,\n5: list<Task> taskList,\n6: bool done,\n7: bool started,\n}\n\n# Represents a query -\n# The graph maintains the stage dependency.In case of conditional tasks, it is represented as if only\n# one of the dependencies need to be executed\nstruct Query {\n1: string queryId,\n2: string queryType,\n3: map<string, string> queryAttributes,\n4: map<string, i64> queryCounters,\n5: Graph stageGraph,\n6: list<Stage> stageList,\n7: bool done,\n8: bool started,\n}\n\n# List of all queries - each query maintains if it is done or started\n# This can be used to track all the queries in the session\nstruct QueryPlan {\n1: list<Query> queries,\n2: bool done,\n3: bool started,\n}\n"
  },
  {
    "path": "src/hiveserver/if/share/fb303/if/fb303.thrift",
    "content": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * fb303.thrift\n */\n\nnamespace java com.facebook.fb303\nnamespace cpp facebook.fb303\nnamespace perl Facebook.FB303\n\n/**\n * Common status reporting mechanism across all services\n */\nenum fb_status {\n  DEAD = 0,\n  STARTING = 1,\n  ALIVE = 2,\n  STOPPING = 3,\n  STOPPED = 4,\n  WARNING = 5,\n}\n\n/**\n * Standard base service\n */\nservice FacebookService {\n\n  /**\n   * Returns a descriptive name of the service\n   */\n  string getName(),\n\n  /**\n   * Returns the version of the service\n   */\n  string getVersion(),\n\n  /**\n   * Gets the status of this service\n   */\n  fb_status getStatus(),\n\n  /**\n   * User friendly description of status, such as why the service is in\n   * the dead or warning state, or what is being started or stopped.\n   */\n  string getStatusDetails(),\n\n  /**\n   * Gets the counters for this service\n   */\n  map<string, i64> getCounters(),\n\n  /**\n   * Gets the value of a single counter\n   */\n  i64 getCounter(1: string key),\n\n  /**\n   * Sets an option\n   */\n  void setOption(1: string key, 2: string value),\n\n  /**\n   * Gets an option\n   */\n  string getOption(1: string key),\n\n  /**\n   * Gets all options\n   */\n  map<string, string> getOptions(),\n\n  /**\n   * Returns a CPU profile over the given time interval (client and server\n   * must agree on the profile format).\n   */\n  string getCpuProfile(1: i32 profileDurationInSec),\n\n  /**\n   * Returns the unix time that the server has been running since\n   */\n  i64 aliveSince(),\n\n  /**\n   * Tell the server to reload its configuration, reopen log files, etc\n   */\n  oneway void reinitialize(),\n\n  /**\n   * Suggest a shutdown to the server\n   */\n  oneway void shutdown(),\n\n}\n"
  },
  {
    "path": "test/t_access_control.js",
    "content": "var testCase = require('nodeunit').testCase;\nvar access_control = require('shib/access_control'),\n    AccessControl = access_control.AccessControl;\n\nmodule.exports = testCase({\n  /*\n  setUp: function (callback) {\n    this.foo = 'bar';\n    callback();\n  },\n   */\n  test1: function (test) {\n    test.equals('bar', 'bar');\n    test.done();\n  },\n  default_rule: function(test){\n    var rule = {};\n    var acl = new AccessControl(rule);\n\n    test.ok(acl.visible('default'));\n    test.ok(acl.visible('db1'));\n\n    test.ok(acl.allowed('t1', 'default'));\n    test.ok(acl.allowed('t2', 'default'));\n    test.ok(acl.allowed('WhatsTable', 'db1'));\n\n    test.done();\n  },\n  default_allowed: function(test){\n    var rule = {\n      default: \"allow\",\n      databases: {\n        secret: { default: \"deny\" },\n        secret2: { default: \"deny\", allow: [\"t1\"] }\n      }\n    };\n    var acl = new AccessControl(rule);\n\n    test.ok(acl.visible('default'));\n    test.ok(! acl.visible('secret'));\n    test.ok(acl.visible('secret2'));\n\n    test.ok(acl.allowed('t1', 'default'));\n    test.ok(acl.allowed('t2', 'default'));\n    test.ok(acl.allowed('WhatsTable', 'db1'));\n\n    test.ok(! acl.allowed('table', 'secret'));\n\n    test.ok(! acl.allowed('table', 'secret2'));\n    test.ok(acl.allowed('t1', 'secret2'));\n\n    test.done();\n  },\n  default_denied: function(test){\n    var rule = {\n      default: \"deny\",\n      databases: {\n        default: { default: \"allow\" },\n        test: { default: \"allow\", deny: [\"IDMaster\", \"secretTest\"] },\n        data: { default: \"deny\", allow: [\"t1\", \"t2\"] }\n      }\n    };\n    var acl = new AccessControl(rule);\n\n    test.ok(! acl.visible(\"unknown\"));\n    test.ok(acl.visible(\"default\"));\n    test.ok(acl.visible(\"test\"));\n    test.ok(acl.visible(\"data\"));\n\n    test.ok(acl.allowed('t1', 'default'));\n    test.ok(acl.allowed('t2', 'default'));\n\n    test.ok(! acl.allowed('WhatsTable', 'db1'));\n\n    test.ok(acl.allowed('table', 'test'));\n    test.ok(acl.allowed('t1', 'test'));\n    test.ok(! acl.allowed('IDMaster', 'test'));\n    test.ok(! acl.allowed('secretTest', 'test'));\n\n    test.ok(! acl.allowed('table', 'data'));\n    test.ok(! acl.allowed('table2', 'data'));\n    test.ok(acl.allowed('t1', 'data'));\n    test.ok(acl.allowed('t2', 'data'));\n\n    test.done();\n  },\n  tearDown: function (callback) {\n    // clean up\n    callback();\n  }\n});\n"
  },
  {
    "path": "test/t_query.js",
    "content": "var testCase = require('nodeunit').testCase;\nvar query = require('shib/query'),\n    Query = query.Query;\n\nvar convertSerializedQueryToArgs = function(array){\n  var obj = {\n    id: array[0],\n    datetime: array[1],\n    scheduled: array[2],\n    engine: array[3] || null,\n    dbname: array[4] || null,\n    querystring: array[5],\n    state: array[6],\n    resultid: array[7],\n    result: array[8]\n  };\n  return obj;\n};\n\nmodule.exports = testCase({\n  /*\n  setUp: function (callback) {\n    this.foo = 'bar';\n    callback();\n  },\n   */\n  test1: function (test) {\n    test.equals('bar', 'bar');\n    test.done();\n  },\n  removeNewLines: function(test) {\n    test.equals(query.removeNewLines('hoge'), 'hoge');\n    test.equals(query.removeNewLines(\"hoge\\n\"), 'hoge ');\n    test.equals(query.removeNewLines(\"ho\\nge\"), 'ho ge');\n    test.equals(query.removeNewLines(\"\\nhoge\"), ' hoge');\n    test.equals(query.removeNewLines(\"\\nhoge\\n\"), ' hoge ');\n    test.equals(query.removeNewLines(\"\\nho\\n\\nge\\n\"), ' ho  ge ');\n    test.done();\n  },\n  removeNewLinesAndComments: function(test) {\n    test.equals(query.removeNewLinesAndComments('hoge'), 'hoge');\n    test.equals(query.removeNewLinesAndComments(\"hoge\\n\"), 'hoge ');\n    test.equals(query.removeNewLinesAndComments(\"ho\\nge\"), 'ho ge');\n    test.equals(query.removeNewLinesAndComments(\"\\nhoge\"), ' hoge');\n    test.equals(query.removeNewLinesAndComments(\"\\nhoge\\n\"), ' hoge ');\n    test.equals(query.removeNewLinesAndComments(\"\\nho\\n\\nge\\n\"), ' ho  ge ');\n\n    test.equals(query.removeNewLinesAndComments('hoge\\n--pos'), 'hoge ');\n    test.equals(query.removeNewLinesAndComments('hoge\\n--pos\\nmoge'), 'hoge  moge');\n    test.equals(query.removeNewLinesAndComments('--koge\\nhoge\\n--pos\\nmoge'), ' hoge  moge');\n    test.equals(query.removeNewLinesAndComments('hoge --koge\\nhoge\\n--pos\\nmoge'), 'hoge  hoge  moge');\n    test.equals(query.removeNewLinesAndComments(' --koge\\nhoge\\n--pos\\nmoge'), '  hoge  moge');\n\n    test.done();\n  },\n  checkQueryString: function(test) {\n    test.throws(function(){Query.checkQueryString('');});\n    test.throws(function(){Query.checkQueryString('select count(*)');});\n    test.throws(function(){Query.checkQueryString('show tables');});\n    test.throws(function(){Query.checkQueryString('describe hoge_table');});\n    test.throws(function(){Query.checkQueryString('create table hoge (col1 as string, col2 as bigint)');});\n    test.throws(function(){Query.checkQueryString('drop table hoge');});\n    test.throws(function(){Query.checkQueryString('alter table hoge (col1 as smallint)');});\n    test.throws(function(){Query.checkQueryString(\"insert overwrite into hoge\\nselect col1,col2 from hoge where moge='pos'\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\"select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\" select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\"with tbl as (select id from source where id > 10) select count(id) from tbl\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\" with tbl as (select id from source where id > 10) select count(id) from tbl\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\"explain select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()\");});\n    test.doesNotThrow(function(){Query.checkQueryString(\" explain select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()\");});\n    test.throws(function(){\n      Query.checkQueryString(\"select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today(); drop table hoge_table\");\n    });\n    test.doesNotThrow(function(){Query.checkQueryString(\"-- TEST Query \\n select field1,field2,count(*) as cnt from hoge_table where yyyymmdd=today()\");});\n    test.done();\n  },\n  generateQueryId: function(test) {\n    test.equals(Query.generateQueryId('select * from hoge where id=111'), 'cec9ab9d980c1b3ed582471dc79eb65b');\n    test.equals(Query.generateQueryId('select x,y from hoge where id=111'), '4f9adf64784f5cb7d0f32fc67e2f387c');\n\n    test.equals(Query.generateQueryId('select * from hoge where id=111', '201108'), '14838f269a5aed68f61bc60615d21330');\n    test.equals(Query.generateQueryId('select x,y from hoge where id=111', '201108'), '5949bf0ce322195db18f045fc70c6159');\n    test.done();\n  },\n  instanciate: function(test) {\n    var q1 = new Query({querystring:'select f1,f2 from hoge_table'});\n    test.equals(q1.queryid, Query.generateQueryId('select f1,f2 from hoge_table'));\n    test.equals(q1.querystring, 'select f1,f2 from hoge_table');\n    test.deepEqual(q1.result, Query.generateResult(null));\n\n    var q2 = new Query({querystring:'select f1,f2 from hoge_table where service=\"news\"'});\n    test.equals(q2.queryid, Query.generateQueryId('select f1,f2 from hoge_table where service=\"news\"'));\n    test.equals(q2.querystring, 'select f1,f2 from hoge_table where service=\"news\"');\n    test.deepEqual(q2.result, Query.generateResult(null));\n\n    var q3 = new Query({querystring:'select f1,f2 from hoge_table where service=\"news\"', seed:'201108'});\n    test.equals(q3.queryid, Query.generateQueryId('select f1,f2 from hoge_table where service=\"news\"', '201108'));\n    test.equals(q3.querystring, 'select f1,f2 from hoge_table where service=\"news\"');\n    test.deepEqual(q3.result, Query.generateResult(null));\n\n    test.done();\n  },\n  serialized: function(test) {\n    // id,datetime,engine,dbname,expression,state,resultid,result\n\n    var q1 = new Query({querystring:'select f1,f2 from hoge_table'});\n    test.deepEqual(\n        q1.serialized(),\n        [\n          \"c148cdb90a70ef34dab88d8e1af967a6\",\n          q1.datetime.toJSON(),\n          null,\n          undefined,\n          undefined,\n          \"select f1,f2 from hoge_table\",\n          'running',\n          Query.generateResultId(\"c148cdb90a70ef34dab88d8e1af967a6\", q1.datetime.toLocaleString()),\n          '{\"error\":\"\",\"lines\":null,\"bytes\":null,\"completed_at\":null,\"completed_msec\":null,\"schema\":[]}'\n        ]\n    );\n    var q1x = new Query(convertSerializedQueryToArgs(q1.serialized()));\n    test.equals(q1x.queryid, q1.queryid);\n    test.equals(q1x.querystring, q1.querystring);\n    test.equals(q1x.state, q1.state);\n    test.equals(q1x.resultid, q1.resultid); // resultid depends on executed_at (default, current time)\n    test.deepEqual(q1x.result, q1.result);\n\n    var q2 = new Query({querystring:'select f1,f2 from hoge_table where service=\"news\"'});\n    test.deepEqual(\n        q2.serialized(),\n        [\n          \"2734efa50f0dff08129e3485b523f782\",\n          q2.datetime.toJSON(),\n          null,\n          undefined,\n          undefined,\n          'select f1,f2 from hoge_table where service=\"news\"',\n          'running',\n          Query.generateResultId(\"2734efa50f0dff08129e3485b523f782\", q2.datetime.toLocaleString()),\n          '{\"error\":\"\",\"lines\":null,\"bytes\":null,\"completed_at\":null,\"completed_msec\":null,\"schema\":[]}'\n        ]\n    );\n    var q2x = new Query(convertSerializedQueryToArgs(q2.serialized()));\n    test.equals(q2x.queryid, q2.queryid);\n    test.equals(q2x.querystring, q2.querystring);\n    test.equals(q2x.state, q2.state);\n    test.equals(q2x.resultid, q2.resultid);\n    test.deepEqual(q2x.result, q2.result);\n    \n    test.done();\n  },\n  serializedForUpdate: function(test){\n    var data = (new Query({querystring:'select f1,f2 from hoge_table'})).serializedForUpdate();\n    test.deepEqual(\n        data,\n        [\n          'running',\n          '{\"error\":\"\",\"lines\":null,\"bytes\":null,\"completed_at\":null,\"completed_msec\":null,\"schema\":[]}',\n          \"c148cdb90a70ef34dab88d8e1af967a6\"\n        ]\n    );\n    test.done();\n  },\n  composed: function(test) {\n    var s0 = \"select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xtable where f1='value1'\";\n    var q0 = new Query({querystring:s0});\n    test.equals(q0.composed(), s0);\n\n    var s1 = \"select f1,f2,f3,f4,f5,f6,f7,f8,f9 from moge where f1='value1'\";\n    var q1 = new Query({querystring:s1});\n    test.equals(q1.composed(), \"select f1,f2,f3,f4,f5,f6,f7,f8,f9 from moge where f1='value1'\");\n\n    var s2 = \"select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xxx where f1='test' and f2='test'\";\n    var q2 = new Query({querystring:s2});\n    test.equals(q2.composed(), \"select f1,f2,f3,f4,f5,f6,f7,f8,f9 from xxx where f1='test' and f2='test'\");\n\n    test.done();\n  },\n  parseTableNames: function(test) {\n    var q0 = 'SELECT * FROM t1';\n    test.deepEqual(Query.parseTableNames(q0), [['t1', null]]);\n\n    var q1 = 'SELECT * FROM db1.sales WHERE amount > 10 AND region = \"US\"';\n    test.deepEqual(Query.parseTableNames(q1), [['sales', 'db1']]);\n\n    var q2 = 'SELECT page_views.* FROM page_views\\nWHERE page_views.date >= \"2008-03-01\" \\nAND page_views.date <= \"2008-03-31\"';\n    test.deepEqual(Query.parseTableNames(q2), [['page_views', null]]);\n\n    var q3 = 'SELECT * FROM Source TABLESAMPLE(BUCKET 3 OUT OF 32 ON rand()) s;';\n    test.deepEqual(Query.parseTableNames(q3), [['Source', null]]);\n\n    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)\";\n    test.deepEqual(Query.parseTableNames(q4), [['action_video', null], ['action_comment', null], ['users', null]]);\n\n    var j0 = 'SELECT a.* FROM a JOIN b ON (a.id = b.id AND a.department = b.department)';\n    test.deepEqual(Query.parseTableNames(j0), [['a', null], ['b', null]]);\n\n    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)';\n    test.deepEqual(Query.parseTableNames(j1), [['a', 'db1'], ['b', 'db2'], ['c', null]]);\n\n    var j2 = 'SELECT a.val, b.val FROM a LEFT OUTER JOIN b ON (a.key=b.key)';\n    test.deepEqual(Query.parseTableNames(j2), [['a', null], ['b', null]]);\n\n    var j3 = 'SELECT a.key, a.val\\nFROM a LEFT SEMI JOIN b on (a.key = b.key)';\n    test.deepEqual(Query.parseTableNames(j3), [['a', null], ['b', null]]);\n\n    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\")';\n    test.deepEqual(Query.parseTableNames(j4), [['page_views', null], ['dim_users', null]]);\n\n    /*\nselect 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)\n     */\n    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) ';\n    test.deepEqual(Query.parseTableNames(j5), [['bigTable', null], ['smallTableOne', null], ['smallTableTwo', null]]);\n\n    var s0 = 'SELECT col\\nFROM (\\n  SELECT a+b AS col\\n  FROM t1\\n) t2';\n    test.deepEqual(Query.parseTableNames(s0), [['t1', null]]);\n\n    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';\n    test.deepEqual(Query.parseTableNames(s1), [['t1', 'd1'], ['t2', 'd2']]);\n\n    var s2 = 'SELECT *\\nFROM A\\nWHERE A.a IN (SELECT foo FROM B);';\n    test.deepEqual(Query.parseTableNames(s2), [['A', null], ['B', null]]);\n\n    var s3 = 'SELECT A FROM T1 WHERE EXISTS (SELECT B FROM T2 WHERE T1.X = T2.Y)';\n    test.deepEqual(Query.parseTableNames(s3), [['T1', null], ['T2', null]]);\n\n    var s4 = 'SELECT col1 FROM (SELECT col1, SUM(col2) AS col2sum FROM t1 GROUP BY col1) t2 WHERE t2.col2sum > 10';\n    test.deepEqual(Query.parseTableNames(s4), [['t1', null]]);\n\n    test.done();\n  },\n  tearDown: function (callback) {\n    // clean up\n    callback();\n  }\n});\n"
  },
  {
    "path": "test/t_simple_csv_builder.js",
    "content": "var testCase = require('nodeunit').testCase;\nvar builder = require('shib/simple_csv_builder').SimpleCSVBuilder;\n\nmodule.exports = testCase({\n  /*\n  setUp: function (callback) {\n    this.foo = 'bar';\n    callback();\n  },\n   */\n  test1: function (test) {\n    test.equals('bar', 'bar');\n    test.done();\n  },\n  escape: function (test) {\n    test.equals(builder.escape(''), '');\n    test.equals(builder.escape('hoge'), 'hoge');\n    test.equals(builder.escape('hoge hoge'), 'hoge hoge');\n    test.equals(builder.escape('hoge,pos'), 'hoge,pos');\n    test.equals(builder.escape('hoge\"pos'), 'hoge\"\"pos');\n    test.equals(builder.escape('hoge\\'pos'), 'hoge\\'pos');\n    test.equals(builder.escape('\"hoge\"pos'), '\"\"hoge\"\"pos');\n    test.equals(builder.escape('hoge\"\"pos'), 'hoge\"\"\"\"pos');\n    test.done();\n  },\n  build: function (test) {\n    test.equals(builder.build([]), '');\n    test.equals(builder.build(['']), '\"\"\\n');\n    test.equals(builder.build(['','']), '\"\",\"\"\\n');\n    test.equals(builder.build(['a']), '\"a\"\\n');\n    test.equals(builder.build(['aa']), '\"aa\"\\n');\n    test.equals(builder.build(['a\"b']), '\"a\"\"b\"\\n');\n    test.equals(builder.build(['a','b']), '\"a\",\"b\"\\n');\n    test.equals(builder.build(['a\"x','b']), '\"a\"\"x\",\"b\"\\n');\n    test.equals(builder.build(['a\"','b']), '\"a\"\"\",\"b\"\\n');\n    test.equals(builder.build(['a','b', 'c']), '\"a\",\"b\",\"c\"\\n');\n    test.equals(builder.build(['a','b', '', 'c']), '\"a\",\"b\",\"\",\"c\"\\n');\n    test.equals(builder.build(['a','b', null, 'c']), '\"a\",\"b\",\"\",\"c\"\\n');\n    test.equals(builder.build(['a','b', undefined, 'c']), '\"a\",\"b\",\"\",\"c\"\\n');\n    test.equals(builder.build(['a','b', 0, 'c']), '\"a\",\"b\",\"0\",\"c\"\\n');\n    test.done();\n  }\n});\n"
  },
  {
    "path": "test/t_thrifthivemock.js",
    "content": "var testCase = require('nodeunit').testCase;\nvar mock = require('./../testtools/ThriftHiveMock');\n\nmodule.exports = testCase({\n  /*\n  setUp: function (callback) {\n    this.foo = 'bar';\n    callback();\n  },\n   */\n  test1: function (test) {\n    test.equals('bar', 'bar');\n    test.done();\n  },\n  generate_tablename: function(test) {\n    var tname = null;\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    tname = mock.generate_tablename();\n    test.ok(/^[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d(_[a-z]{1,3}\\d)?)?)?$/.exec(tname));\n    test.done();\n  },\n  generate_subtree: function(test){\n    test.deepEqual(mock.generate_subtree('xxx1'), ['xxx=0']);\n    test.deepEqual(mock.generate_subtree('xxx3'), ['xxx=0','xxx=1','xxx=2']);\n    test.deepEqual(mock.generate_subtree('xxx2'), ['xxx=0','xxx=1']);\n    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']);\n\n    test.deepEqual(mock.generate_subtree('xxy1_abc2'), ['xxy=0/abc=0', 'xxy=0/abc=1']);\n    test.deepEqual(mock.generate_subtree('xxy1_abc3'), ['xxy=0/abc=0', 'xxy=0/abc=1', 'xxy=0/abc=2']);\n    test.deepEqual(mock.generate_subtree('xxy2_abc2'), ['xxy=0/abc=0', 'xxy=0/abc=1', 'xxy=1/abc=0', 'xxy=1/abc=1']);\n    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']);\n    test.done();\n  }\n});\n"
  },
  {
    "path": "testtools/ThriftHiveMock.js",
    "content": "var hive_service_types = require('shib/engines/hiveserver/hive_service_types'),\n    hive_metastore_types = require('shib/engines/hiveserver/hive_metastore_types'),\n    queryplan_types = require('shib/engines/hiveserver/queryplan_types');\n\nvar chars = [\n  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n  'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\n  '-', ' ', '_', '\\'', '\"', '?', '!', '=', '+', '/', '.', ','\n];\nvar namechars = [\n  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n  'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',\n  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'\n];\nvar alphabet_namechars = [\n  'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',\n  'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'\n];\nvar kana_chars = [\n  'あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ',\n  'さ', 'し', 'す', 'せ', 'そ', 'た', 'ち', 'つ', 'て', 'と',\n  'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'へ', 'ほ',\n  'ま', 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ',\n  'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'を', 'ん'\n];\nvar random_num = function(max){ return Math.floor(Math.random() * max) + 1; };\nvar random_index = function(max){ return Math.floor(Math.random() * max); };\nvar choose = function(list){\n  return list[random_index(list.length)];\n};\nvar random_string = function(len){\n  var ret = '';\n  for (var i = 0; i < len; i++){ ret += choose(chars); }\n  return ret;\n};\nvar random_name = function(len){\n  var ret = '';\n  for (var i = 0; i < len; i++){ ret += choose(namechars); }\n  return ret;\n};\nvar random_kana = function(len){\n  var ret = '';\n  for (var i = 0; i < len; i++){ ret += choose(kana_chars); }\n  return ret;\n};\nvar random_alphabetname = function(len){\n  var ret = '';\n  for (var i = 0; i < len; i++){ ret += choose(alphabet_namechars); }\n  return ret;\n};\nexports.cluster_status = function(){\n  return new hive_service_types.HiveClusterStatus({\n    taskTrackers: 1,\n    mapTasks: 0,\n    reduceTasks: 0,\n    maxMapTasks: 2,\n    maxReduceTasks: 2,\n    state: 2\n  });\n};\n\nvar idlist = ['hadoop_20110408154949_8b2be199-02ae-40fe-9492-d197ade572f2',\n              'hadoop_20110408154949_8b2be199-03ff-40fe-9492-d197ade572f2',\n              'hadoop_20110408154949_8b2be199-04bc-40fe-9492-d197ade572f2',\n              'hadoop_20110408154949_8b2be199-05db-40fe-9492-d197ade572f2',\n              'hadoop_20110408154949_8b2be199-06fc-40fe-9492-d197ade572f2'];\nvar queryId = function(){ return choose(idlist); };\nvar operator = function(num){\n  var o = new queryplan_types.Operator({\n    operatorId: 'TS_12' + num,\n    operatorType: Math.floor(Math.random() * 10),\n    operatorAttributes: null,\n    operatorCounters: null,\n    done: true,\n    started: true\n  }); \n  return o;\n};\nvar operatorGraph = function(ops){\n  var al = [];\n  for (var i = 0; i < ops.length - 1; i++){\n    al.push(new queryplan_types.Adjacency({ node: ops[i].operatorId, children: [ ops[i+1].operatorId ], adjacencyType: 0 }));\n  }\n  return new queryplan_types.Graph({\n    nodeType: 0,\n    roots: null,\n    adjacencyList: al\n  });\n};\nvar task = function(stage,mapreduce,operators){\n  var ops = [];\n  for (var i = 0; i < operators; i++){ ops.push(operator(i)); }\n  return new queryplan_types.Task({\n    taskId: 'Stage-' + stage + '_' + mapreduce,\n    taskType: (mapreduce == 'MAP' ? 0 : 1),\n    taskAttributes: null,\n    taskCounters: null,\n    operatorList: ops,\n    operatorGraph: operatorGraph(ops),\n    done: true,\n    started: true\n  });\n};\n\nvar stage = function(stage){\n  var cntr_map = 'CNTR_NAME_Stage-' + stage + '_MAP_PROGRESS';\n  var cntr_reduce = 'CNTR_NAME_Stage-' + stage + '_REDUCE_PROGRESS';\n  var counters = {};\n  counters[cntr_map] = 100;\n  counters[cntr_reduce] = 100;\n  return new queryplan_types.Stage({\n    stageId: 'Stage-' + stage,\n    stageType: 3,\n    stageAttributes: null,\n    stageCounters: counters,\n    taskList: [task(stage,'MAP',3), task(stage,'REDUCE',1)],\n    done: true,\n    started: true\n  });\n};\n\nexports.query_plan = function(querystring){\n  if (querystring == undefined){\n    return new queryplan_types.QueryPlan({});\n  }\n\n  var query = new queryplan_types.Query({\n    queryId: queryId(),\n    queryType: null,\n    queryAttributes: { queryString: querystring },\n    queryCounters: null,\n    stageList: [stage(1), stage(2)],\n    stageGraph: new queryplan_types.Graph({\n      nodeType: 1,\n      roots: null,\n      adjacencyList: [ new queryplan_types.Adjacency({ node: 'Stage-1', children: [ 'Stage-2' ], adjacencyType: 0 }) ]\n    }),\n    done: true,\n    started: true\n  });\n  return new queryplan_types.QueryPlan({ queries: [query], done: false, started: false });\n};\n\nvar columns = function(query){\n  var match = /select (.*) from .*/im.exec(query);\n  if (! match)\n    throw new Error('query field definition invalid!');\n  return match[1].split(/, /).map(function(s){return s.trim();});\n};\n\nvar columninfo = function(column){\n  var name = column;\n  var type = 'string';\n  var ex = undefined;\n\n  var match = /as ([_a-zA-Z0-9]*)$/im.exec(column);\n  if (match){\n    name = match[1];\n  }\n  if (/^count/im.exec(column)) {\n    type = 'bigint';\n    ex = 'count';\n  }\n  else if (/^(sum|avg|min|max)/im.exec(column)) {\n    type = 'bigint';\n    ex = 'aggr';\n  }\n  else if (/id$/.exec(name)) {\n    type = 'bigint';\n    ex = 'id';\n  }\n\n  if (/^\"(.*)\"$/.exec(name)) {\n    name = /^\"(.*)\"$/.exec(name)[1];\n    ex = \"strcopy\";\n  }\n  else if (name == 'yyyymmdd') {\n    ex = 'date';\n  }\n  else if (name == 'hhmm' || name == 'hhmmss') {\n    ex = 'time';\n  }\n  else if (/name$/i.exec(name)) {\n    ex = 'name';\n  }\n  else if (/kana$/i.exec(name)) {\n    ex = 'kana';\n  }\n\n  return {name: name, type: type, ex: ex};\n};\n\nexports.schema = function(query){\n  if (! query) {\n    return new hive_metastore_types.Schema({});\n  }\n\n  if (/^show (databases|tables|partitions)/i.exec(query)) {\n    return new hive_metastore_types.Schema({\n      fieldSchemas: [new hive_metastore_types.FieldSchema({name: 'name', type: 'string', comment: undefined})],\n      properties: null\n    });\n  }\n  if (/^describe/i.exec(query)) {\n    return new hive_metastore_types.Schema({\n      fieldSchemas: [\n        new hive_metastore_types.FieldSchema({name: 'col_name', type: 'string', comment: 'from deserializer'}),\n        new hive_metastore_types.FieldSchema({name: 'data_type', type: 'string', comment: 'from deserializer'}),\n        new hive_metastore_types.FieldSchema({name: 'comment', type: 'string', comment: 'from deserializer'})\n      ],\n      properties: null\n    });\n  }\n\n  var cols = columns(query.split('\\n').join(' '));\n  return new hive_metastore_types.Schema({\n    fieldSchemas: cols.map(function(c){\n      var i = columninfo(c);\n      return new hive_metastore_types.FieldSchema({name: i.name, type: i.type, comment: undefined});\n    }),\n    properties: null\n  });\n};\n\nvar generateValue = function(colinfo){\n  function pad(n){return n<10 ? '0'+n : n;}\n  switch(colinfo.ex) {\n  case 'strcopy':\n    return colinfo.name;\n  case 'date':\n    var d1 = new Date((new Date()).getTime() - random_num(50) * 86400 * 1000);\n    return '' + d1.getFullYear() + pad(d1.getMonth()+1) + pad(d1.getDate());\n  case 'time':\n    var d2 = new Date((new Date()).getTime() - random_num(12 * 60) * 60 * 1000);\n    return '' + pad(d2.getHours()) + pad(d2.getMinutes());\n  case 'id':\n    return random_num(500);\n  case 'aggr':\n    return random_num(10000);\n  case 'count':\n    return random_num(2000);\n  case 'name':\n    return random_name(random_num(10));\n  case 'kana':\n    return random_kana(random_num(10));\n  }\n  if (colinfo.type == 'string'){\n    return random_string(random_num(50));\n  }\n  return random_num(100);\n};\n\nvar generate_tablename = exports.generate_tablename = function(){\n  var part_depth = choose([1,1,2,2,3,4]);\n  var name = '';\n  for (var i = 0; i < part_depth; i++) {\n    if (name.length > 0)\n      name += '_';\n    name += random_alphabetname(3) + random_num(3);\n  }\n  return name;\n};\n\nvar generate_subtree = exports.generate_subtree = function(subtree_label, parent) {\n  var parent_part = parent ? parent + '/' : '';\n  var current_depth_label = subtree_label;\n  var children_label = null;\n  if (subtree_label.indexOf('_') > -1) {\n    var separator = subtree_label.indexOf('_');\n    current_depth_label = subtree_label.substring(0, separator);\n    children_label = subtree_label.substring(separator + 1);\n  }\n  \n  var matched = /^([a-z]+)(\\d+)$/.exec(current_depth_label);\n  var fieldname = matched[1];\n  var partsNum = Number(matched[2]);\n  var parts = [];\n  for (var i = 0; i < partsNum; i++) {\n    var current_part = parent_part + fieldname + '=' + i;\n    if (children_label) {\n      parts = parts.concat(generate_subtree(children_label, current_part));\n    }\n    else {\n      parts.push(current_part);\n    }\n  }\n  return parts;\n};\n\nexports.result = function(query){\n  var rows = choose([0,1,1,1,1,2,3,5,7,10,20,50]);\n  var matched = null;\n  if ((matched = /^show (databases|tables|partitions)( (.*))?$/i.exec(query)) != null) {\n    if (/^databases$/i.exec(matched[1])) { /* show databases */\n      if (rows < 1)\n        rows = 1;\n      var dbs = [];\n      for (var x = 0; x < rows; x++) {\n        var dbname = generate_tablename();\n        while (dbs.indexOf(dbname) > -1)\n          dbname = generate_tablename();\n        dbs.push(dbname);\n      }\n      return dbs;\n    }\n    else if (/^tables$/i.exec(matched[1])) { /* show tables */\n      if (rows < 1)\n        rows = 1;\n      var tables = [];\n      for (var i = 0; i < rows; i++) {\n        var name = generate_tablename();\n        while (tables.indexOf(name) > -1)\n          name = generate_tablename();\n        tables.push(name);\n      }\n      return tables;\n    }\n    else { /* show partitions hogetable */\n      var tablename = matched[3];\n      if (! tablename)\n        return [];\n      return generate_subtree(tablename);\n    }\n  }\n  if ((matched = /^describe (.*)$/i.exec(query)) != null) {\n    var tname = matched[1];\n    var fields = [];\n    var types = ['string', 'string', 'string', 'smallint', 'bigint', 'boolean'];\n    if (rows < 1)\n      rows = 1;\n    for (var k = 0; k < rows; k++){\n      fields.push(random_name(10) + '\\t' + choose(types) + '\\t' + tname + '___' + k);\n    }\n    return fields;\n  }\n  else {\n    var colinfos = columns(query).map(function(c){return columninfo(c);});\n    var limitmatch = /limit (\\d+)/i.exec(query);\n    if (colinfos.length == 1 && colinfos[0].ex == 'count') {\n      rows = 1;\n    }\n    else if (limitmatch) {\n      rows = limitmatch[1];\n    }\n    var values = [];\n    for (var j = 0; j < rows; j++){\n      values.push(colinfos.map(function(c){ return generateValue(c); }).join(\"\\t\"));\n    }\n    return values;\n  }\n};\n"
  },
  {
    "path": "testtools/check_database_hs2_engine.js",
    "content": "var async = require('async');\nvar Executer = require('shib/engines/hiveserver2/test').Executer;\n\nvar host = ''\n  , port = 10000\n  , username = ''\n  , password = '';\n\nvar test_database = ''\n  , test_table = '';\n\nvar executer = new Executer({\n  name: 'hiveserver2',\n  host: host,\n  port: port,\n  username: username,\n  password: password\n});\n\n// Executer.prototype.execute = function(jobname, dbname, query, callback)\n\nasync.series([\n  function(cb){\n    executer.databases(function(err, result){\n      console.log({label:\"RESULT: databases()\", result:result});\n      cb();\n    });\n  },\n  function(cb){\n    executer.tables(test_database, function(err, result){\n      console.log({label:\"RESULT tables()\", result:result});\n      cb();\n    });\n  },\n  function(cb){\n    executer.describe(test_database, test_table, function(err, result){\n      console.log({label:\"RESULT describe()\", result:result});\n      cb();\n    });\n  },\n  function(cb){\n    executer.partitions(test_database, test_table, function(err, result){\n      console.log({label:\"RESULT partitions()\", result:result});\n      cb();\n    });\n  }\n], function(err,results){ executer.end(); console.log(\"END.\"); });\n"
  },
  {
    "path": "testtools/check_database_hs2_use.js",
    "content": "var async = require('async');\nvar Executer = require('shib/engines/hiveserver2').Executer;\n\nvar host = ''\n  , port = 10000\n  , username = ''\n  , password = '';\n\nvar test_database = ''\n  , test_table = '';\n\nvar use_database_statement = \"use \" + test_database;\n\nvar executer = new Executer({\n  name: 'hiveserver2',\n  host: host,\n  port: port,\n  username: username,\n  password: password\n});\n\n// Executer.prototype.execute = function(jobname, dbname, query, callback)\n\nasync.series([\n  function(cb){\n    executer.execute(null, null, \"show databases\", function(err, fetcher){\n      fetcher.fetch(null, function(err, result){\n        console.log({label:\"RESULT: show databases\", result:result});\n        cb();\n      });\n    });\n  },\n  function(cb){\n    executer.setup([use_database_statement], function(err){\n      executer.execute(null, null, \"show tables\", function(err, fetcher){\n        fetcher.fetch(null, function(err, result){\n          console.log({label:\"RESULT show tables\", result:result});\n          cb();\n        });\n      });\n    });\n  },\n  function(cb){\n    executer.setup([use_database_statement], function(err){\n      executer.execute(null, null, \"describe \" + test_table, function(err, fetcher){\n        fetcher.fetch(null, function(err, result){\n          console.log({label:\"RESULT describe\", result:result});\n          cb();\n        });\n      });\n    });\n  },\n  function(cb){\n    executer.setup([use_database_statement], function(err){\n      executer.execute(null, null, \"show partitions \" + test_table, function(err, fetcher){\n        fetcher.fetch(null, function(err, result){\n          console.log({label:\"RESULT show partitions\", result:result});\n          cb();\n        });\n      });\n    });\n  }\n], function(err,results){ executer.end(); console.log(\"END.\"); });\n"
  },
  {
    "path": "testtools/check_engine.js",
    "content": "var engine = require('shib/engine');\n\n// node check_engine.js CONFIG_JS_PATH OPERATION args ...\n//\n// ex: node check_engine ./config.js execute \"SELECT ...\"\n//     node check_engine ./config.js status JOBID JOBNAME\n\n// argv: ['node', 'script_path', arguments]\nvar args = process.argv.concat();\nargs.shift(); args.shift();\n\nvar conf_path = args.shift(),\n    operation = args.shift();\n\nvar conf = (function(path){\n  var exports = {};\n  var ret = eval(require('fs').readFileSync(path).toString());\n  return exports.servers;\n})(conf_path);\n\nvar obj = new engine.Engine(conf.executer, conf.monitor);\n\nconsole.log('engine operation:' + operation + ', args:' + JSON.stringify(args));\nvar shutdown = function(){ obj.close(); };\n\nif (operation === 'supports') {\n  console.log('supports ' + operation + ':' + obj.supports(args[0]));\n} else if (operation === 'execute') {\n  obj.execute('check-engine-query', args[0], {callback: function(err,data){\n    if (err) {\n      console.log('error:');\n      console.log(err);\n    }\n    console.log('data:');\n    console.log(data);\n    shutdown();\n  }});\n} else if (operation === 'status') {\n  obj.status(args[0], function(err,status){\n    console.log({err:err, status:status});\n    shutdown();\n  });\n} else if (operation === 'kill') {\n  obj.kill(args[0], args[1], function(err){\n    console.log({err:err});\n    shutdown();\n  });\n} else {\n  console.log('unknown operation:' + operation);\n  shutdown();\n}\n"
  },
  {
    "path": "testtools/check_engine_huahin_mrv1.js",
    "content": "var huahin_mrv1 = require('shib/engines/huahin_mrv1');\n\n// node check_engine_huahin_mrv1.js HUAHIN_HOST HUAHIN_PORT OPERATION ARGS\n//\n// ex: node check_engine_huahin_mrv1.js localhost 9010 status jobname-foo1\n//     node check_engine_huahin_mrv1.js localhost 9010 kill jobname-foo1\n\n\n// argv: ['node', 'script_path', arguments]\nvar monitor = new huahin_mrv1.Monitor({\n  name: 'huahin_mrv1',\n  host: process.argv[2],\n  port: parseInt(process.argv[3])\n});\n\nvar operation = process.argv[4],\n    jobname = process.argv[5];\n\nconsole.log('huahin_mrv1 ' + operation + ':' + jobname);\nvar shutdown = function(){ monitor.close(); };\n\nif (operation === 'status') {\n  monitor.status(jobname, function(err,status){\n    console.log({err:err, status:status});\n    shutdown();\n  });\n} else if (operation === 'kill') {\n  monitor.kill(null, jobname, function(err){\n    console.log({err:err});\n    shutdown();\n  });\n} else {\n  console.log('unknown operation:' + operation);\n  shutdown();\n}\n"
  },
  {
    "path": "testtools/hive_server_mock.js",
    "content": "var thrift = require('node-thrift'),\n    ttransport = require('node-thrift/lib/thrift/transport');\nvar ThriftHive = require('shib/engines/hiveserver/ThriftHive');\n\nvar mock = require('ThriftHiveMock');\n/*\n * ThriftHive server mock with dummy response,\n *  cannot handle concurrent connections...\n *  cannot send response with exceptions...\n */\n\nvar query = undefined;\nvar query_plan = undefined;\nvar query_schema = undefined;\nvar query_result = [];\n\nvar waited_queries = [];\n\nvar init_status = function(){\n  query_plan = query_schema = query = undefined;\n  query_result = [];\n};\n\nsetInterval(function(){\n  if (query != undefined || waited_queries.length < 1) {\n    return;\n  }\n  query_plan = mock.query_plan(waited_queries[0]);\n  query_schema = mock.schema(waited_queries[0]);\n  query_result = mock.result(waited_queries[0]);\n  query = waited_queries.shift();\n}, 250);\n\nvar execute = function(queued_query, success){\n  var q = queued_query.split('\\n').join(' ');\n  var executeDelay = 0;\n  var matched = null;\n  console.log('=================================================');\n  console.log(q);\n  if ((matched = /-- sleep ([0-9]+)$/im.exec(queued_query)) !== null) {\n    executeDelay = Number(matched[1]) * 1000;\n    console.log('sleep detected:' + executeDelay);\n  }\n  console.log('=================================================');\n\n  if (/^set .*/.exec(queued_query)) {\n    success();\n    return;\n  }\n\n  setTimeout(function(){\n    waited_queries.push(q);\n    console.log(\"query pushed:\" + q);\n  }, executeDelay);\n\n  var timer = setInterval(function(){\n    if (query != q) {\n      return;\n    };\n    console.log('target query executed');\n    clearInterval(timer);\n    success();\n  }, 500);\n};\n\nvar getClusterStatus = function(success){\n  success(mock.cluster_status());\n};\n\nvar fetchOne = function(success){\n  if (query == undefined) {\n    success('');\n    return;\n  }\n  var val = '';\n  if (query_result.length > 0) {\n    val = query_result.shift();\n  }\n  if (query_result.length == 0) {\n    init_status();\n  }\n  console.log(val);\n  success(val);\n};\n\nvar fetchN = function(rows, success){\n  if (query == undefined) {\n    success(['']);\n    return;\n  }\n  var val = [];\n  for (var i = 0; i < rows; i++) {\n    val.push(query_result.shift());\n    if (query_result.length < 1) {\n      init_status();\n      break;\n    }\n  }\n  console.log(val);\n  success(val);\n};\n\nvar fetchAll = function(success){\n  if (query == undefined) {\n    success(['']);\n    return;\n  }\n  var val = query_result;\n  init_status();\n  console.log(val);\n  success(val);\n};\n\nvar getSchema = function(success){\n  if (query_schema == undefined) {\n    success(mock.schema());\n    return;\n  }\n  success(query_schema);\n};\n\nvar getThriftSchema = function(success){\n  getSchema(success);\n};\n\nvar getQueryPlan = function(success){\n  if (query_plan == undefined) {\n    success(mock.query_plan());\n  }\n  success(query_plan);\n};\n\nvar clean = function(success){\n  success();\n};\n\nvar server_mock = thrift.createServer(ThriftHive, {\n  getClusterStatus: getClusterStatus,\n  execute: execute,\n  fetchOne: fetchOne,\n  fetchN: fetchN,\n  fetchAll: fetchAll,\n  getSchema: getSchema,\n  getThriftSchema: getThriftSchema,\n  getQueryPlan: getQueryPlan,\n  clean: clean\n}, {transport: ttransport.TBufferedTransport});\nserver_mock.listen(10000);\n"
  },
  {
    "path": "var/.datadir",
    "content": ""
  },
  {
    "path": "views/index.jade",
    "content": "doctype html\nhtml\n  head\n    meta(http-equiv=\"Content-Type\", content=\"text/html\", charset=\"utf-8\")\n    title shib - Query your Hive!\n    link(type=\"text/css\", href=\"/css/redmond/jquery-ui-1.8.13.custom.css\", rel=\"stylesheet\")\n    link(type=\"text/css\", href=\"/css/ui.dynatree.css\", rel=\"stylesheet\")\n    link(type=\"text/css\", href=\"/css/shib.css\", rel=\"stylesheet\")\n    link(type=\"text/css\", href=\"http://fonts.googleapis.com/css?family=Artifika:regular\", rel=\"stylesheet\")\n    link(type=\"text/css\", href=\"http://fonts.googleapis.com/css?family=Anonymous+Pro:regular,italic,bold,bolditalic\", rel=\"stylesheet\")\n    script(type=\"text/javascript\", src=\"/js/jquery-1.7.2.min.js\")\n    script(type=\"text/javascript\", src=\"/js/jquery-ui-1.8.13.custom.min.js\")\n    script(type=\"text/javascript\", src=\"/js/jquery.tmpl.min.js\")\n    script(type=\"text/javascript\", src=\"/js/jquery.dynatree.min.js\")\n    script(type=\"text/javascript\", src=\"/js/shib.js\")\n  body\n    #titlearea\n      #title\n        a(href=\"/\") shib\n    #noticearea\n      .ui-widget#errorarea(style=\"display: none;\")\n        .ui-state-error.ui-corner-all(style=\"padding: 0 .7em;\")\n          p\n            span.ui-icon.ui-icon-alert(style=\"float: left; margin-right: .3em;\")\n            strong#errortitle Alert\n            span#errormessage(style=\"margin-left: .7em;\") Error Message\n      .ui-widget#infoarea(style=\"display: none;\")\n        .ui-state-highlight.ui-corner-all(style=\"padding: 0 .7em;\")\n          p\n            span.ui-icon.ui-icon-info(style=\"float: left; margin-right: .3em;\")\n            strong#infotitle TITLE\n            span#infomessage(style=\"margin-left: .7em;\") Highlighted Message\n    #resultdiag(title=\"show result\", style=\"display:none;\")\n      pre#resultdisplay\n    #tablesdiag(title=\"tables status\", style=\"display:none;\")\n      select#table_pairs(style=\"width: 300px;\")\n        option not loaded\n      .loadingimg(style=\"display:none; padding-top: 2em; text-align: center; vertical-align: center;\")\n        image(src=\"/image/ajax-loader.gif\")\n      #tables(style=\"display: none;\")\n    #describediag(title=\"table schema\", style=\"display:none;\")\n      select#desc_pairs(style=\"width: 300px;\")\n        option not loaded\n      .loadingimg(style=\"display:none; padding-top: 2em; text-align: center; vertical-align: center;\")\n        image(src=\"/image/ajax-loader.gif\")\n      #describes\n    #taglistdiag(title=\"tag list\", style=\"display:none;\")\n      .loadingimg(style=\"display:none; padding-top: 2em; text-align: center; vertical-align: center;\")\n        image(src=\"/image/ajax-loader.gif\")\n      ul#taglist\n    #detailstatusdiag(title=\"query status\", style=\"display:none;\")\n      .loadingimg(style=\"display:none; padding-top: 2em; text-align: center; vertical-align: center;\")\n        image(src=\"/image/ajax-loader.gif\")\n      #detailstatus(style=\"display: none;\")\n    #edittagdiag(title=\"add/remove tag\", style=\"display: none;\")\n      input#add_tag_text(type=\"text\", size=\"16\")\n      button#add_tag_submit\n        | Add\n      #removeTagPart(style=\"display: none;\")\n        hr\n        select#remove_tag_list\n          option not loaded\n        button#remove_tag_submit\n          | Remove\n    #authinputdiag(title=\"username/password check\", style=\"display:none;\")\n      form\n        div\n          | Username:\n          input#username(type=\"text\", size=\"16\", placeholder=\"username\")\n          span#authRealm\n            | \n        div\n          | Password:\n          input#password(type=\"password\", size=\"16\", placeholder=\"password\")\n        button#auth_submit(type=\"submit\")\n          | Check username/password\n    #mainarea\n      table\n        tr\n          td#mainviewcell\n            #mainview\n              #tablesbox.ui-corner-all\n                ul.operationitems.ui-widget.ui-helper-clearfix\n                  li#tables_diag.ui-state-default.ui-corner-all(title=\"show tables dialog\")\n                    span.ui-icon.ui-icon-info\n                    | show tables and partitions\n                  li#describe_diag.ui-state-default.ui-corner-all(title=\"show table schema\")\n                    span.ui-icon.ui-icon-info\n                    | show table schemas\n                  li#taglist_diag.ui-state-default.ui-corner-all(title=\"show all tags\")\n                    span.ui-icon.ui-icon-info\n                    | show all tags\n              #dangereditbox.ui-corner-all\n                ul.dangeritems.operationitems.ui-widget.ui-helper-clearfix\n                  li#new_button.ui-state-default.ui-corner-all\n                    span.ui-icon.ui-icon-document\n                    | new query\n                  li#copy_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-copy\n                    | copy to new query\n                  li#clip_button.ui-state-default.ui-corner-all(style=\"display: none; margin-left: 12em;\")\n                    span.ui-icon.ui-icon-link\n                    | add to your bookmark\n                  li#unclip_button.ui-state-default.ui-corner-all(style=\"display: none; margin-left: 12em;\")\n                    span.ui-icon.ui-icon-cancel\n                    | remove from bookmark\n              #querybox\n                textarea#queryeditor(rows=\"14\")\n              #editbox.ui-corner-all\n                #engineselector\n                  select#exec_pairs(style=\"width: 300px;\")\n                    option not loaded\n                ul.operationitems.ui-widget.ui-helper-clearfix\n                  li#auth_button.ui-state-default.ui-corner-all\n                    span.ui-icon.ui-icon-play\n                    | ...authenticate\n                  li#execute_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-play\n                    | execute\n                  li#giveup_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-pause\n                    | give up\n                  li#status_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-search\n                    | status\n                  li#delete_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-trash\n                    | delete\n                  li#display_full_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-newwin\n                    | show full\n                  li#display_head_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-newwin\n                    | show head\n                  li#download_tsv_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-arrowthickstop-1-s\n                    | tsv\n                  li#download_csv_button.ui-state-default.ui-corner-all(style=\"display: none;\")\n                    span.ui-icon.ui-icon-arrowthickstop-1-s\n                    | csv\n                #statusview\n                  span\n                    | Query Status:\n                    span#querystatus.status_not_executed not executed\n                #queryexec(style=\"display: none;\")\n                  div\n                    | Engine:\n                    span#queryengine\n                    | , Database:\n                    span#querydatabase\n                #queryresult(style=\"display: none;\")\n                  div\n                    | Result:\n                    span#queryresultlines 0 lines, \n                    span#queryresultbytes 0 bytes\n                  div#queryresultelapsed\n                  div#queryresultschema\n                ul#querytags.querytags.ui-widget.ui-helper-clearfix(style=\"display: none;\")\n                  li#edit_tag_button.ui-state-default.ui-corner-all\n                    span.ui-icon.ui-icon-pencil\n                    | Edit tag\n          td#tabviewcell\n            #tabview\n              #listSelector\n                ul\n                  li#index-tag\n                    a(href=\"#tab-tag\") tag\n                  li#index-yours\n                    a(href=\"#tab-yours\") yours\n                  li#index-bookmark\n                    a(href=\"#tab-bookmark\") bookmark\n                  li#index-history\n                    a(href=\"#tab-history\") history\n                #tab-tag\n                #tab-yours\n                #tab-bookmark\n                #tab-history\n  #runningarea\n    #runnings.ui-corner-all\n      div no running queries\n  #creditarea\n      #credits\n        | shib by tagomoris\n"
  }
]