示例#1
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveClusterStatus) WriteField6(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteFieldBegin("state", thrift.I32, 6)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(6, "state", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.State))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(6, "state", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(6, "state", p.ThriftName(), err)
	}
	return err
}
示例#2
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveServerException) Write(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	err = oprot.WriteStructBegin("HiveServerException")
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	err = p.WriteField1(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField2(oprot)
	if err != nil {
		return err
	}
	err = p.WriteField3(oprot)
	if err != nil {
		return err
	}
	err = oprot.WriteFieldStop()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(-1, "STOP", p.ThriftName(), err)
	}
	err = oprot.WriteStructEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteStruct(p.ThriftName(), err)
	}
	return err
}
示例#3
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveServerException) WriteField3(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if len(p.SQLState) < 1 {
		return nil
	}
	err = oprot.WriteFieldBegin("SQLState", thrift.STRING, 3)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "SQLState", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.SQLState))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "SQLState", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(3, "SQLState", p.ThriftName(), err)
	}
	return err
}
示例#4
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveServerException) WriteField2(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if int64(p.ErrorCode) == 0 {
		return nil
	}
	err = oprot.WriteFieldBegin("errorCode", thrift.I32, 2)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "errorCode", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.ErrorCode))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "errorCode", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(2, "errorCode", p.ThriftName(), err)
	}
	return err
}
示例#5
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveServerException) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if len(p.Message) < 1 {
		return nil
	}
	err = oprot.WriteFieldBegin("message", thrift.STRING, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "message", p.ThriftName(), err)
	}
	err = oprot.WriteString(string(p.Message))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "message", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "message", p.ThriftName(), err)
	}
	return err
}
示例#6
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveClusterStatus) WriteField5(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if int64(p.MaxReduceTasks) == 0 {
		return nil
	}
	err = oprot.WriteFieldBegin("maxReduceTasks", thrift.I32, 5)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(5, "maxReduceTasks", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.MaxReduceTasks))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(5, "maxReduceTasks", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(5, "maxReduceTasks", p.ThriftName(), err)
	}
	return err
}
示例#7
0
文件: ttypes.go 项目: sundy-li/hive
func (p *HiveClusterStatus) WriteField1(oprot thrift.TProtocol) (err thrift.TProtocolException) {
	if int64(p.TaskTrackers) == 0 {
		return nil
	}
	err = oprot.WriteFieldBegin("taskTrackers", thrift.I32, 1)
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "taskTrackers", p.ThriftName(), err)
	}
	err = oprot.WriteI32(int32(p.TaskTrackers))
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "taskTrackers", p.ThriftName(), err)
	}
	err = oprot.WriteFieldEnd()
	if err != nil {
		return thrift.NewTProtocolExceptionWriteField(1, "taskTrackers", p.ThriftName(), err)
	}
	return err
}