//
// Autogenerated by Thrift
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
var Thrift = require('thrift').Thrift;
var ttypes = module.exports = {};
var BucketStoreMappingException = module.exports.BucketStoreMappingException = function(args){
  Thrift.TException.call(this, "BucketStoreMappingException")
  this.name = "BucketStoreMappingException"
  this.message = null
  this.code = null
if( args != null ){  if (null != args.message)
  this.message = args.message
  if (null != args.code)
  this.code = args.code
}}
Thrift.inherits(BucketStoreMappingException, Thrift.TException)
BucketStoreMappingException.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      case 1:      if (ftype == Thrift.Type.STRING) {
        this.message = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      case 2:      if (ftype == Thrift.Type.I32) {
        this.code = input.readI32()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

BucketStoreMappingException.prototype.write = function(output){ 
  output.writeStructBegin('BucketStoreMappingException')
  if (null != this.message) {
    output.writeFieldBegin('message', Thrift.Type.STRING, 1)
    output.writeString(this.message)
    output.writeFieldEnd()
  }
  if (null != this.code) {
    output.writeFieldBegin('code', Thrift.Type.I32, 2)
    output.writeI32(this.code)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

var HostPort = module.exports.HostPort = function(args){
  this.host = null
  this.port = null
if( args != null ){  if (null != args.host)
  this.host = args.host
  if (null != args.port)
  this.port = args.port
}}
HostPort.prototype = {}
HostPort.prototype.read = function(input){ 
  var ret = input.readStructBegin()
  while (1) 
  {
    var ret = input.readFieldBegin()
    var fname = ret.fname
    var ftype = ret.ftype
    var fid   = ret.fid
    if (ftype == Thrift.Type.STOP) 
      break
    switch(fid)
    {
      case 2:      if (ftype == Thrift.Type.STRING) {
        this.host = input.readString()
      } else {
        input.skip(ftype)
      }
      break
      case 3:      if (ftype == Thrift.Type.I32) {
        this.port = input.readI32()
      } else {
        input.skip(ftype)
      }
      break
      default:
        input.skip(ftype)
    }
    input.readFieldEnd()
  }
  input.readStructEnd()
  return
}

HostPort.prototype.write = function(output){ 
  output.writeStructBegin('HostPort')
  if (null != this.host) {
    output.writeFieldBegin('host', Thrift.Type.STRING, 2)
    output.writeString(this.host)
    output.writeFieldEnd()
  }
  if (null != this.port) {
    output.writeFieldBegin('port', Thrift.Type.I32, 3)
    output.writeI32(this.port)
    output.writeFieldEnd()
  }
  output.writeFieldStop()
  output.writeStructEnd()
  return
}

