// Autogenerated by Thrift Compiler (0.13.0)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package rrdb

import (
	"bytes"
	"context"
	"database/sql/driver"
	"errors"
	"fmt"
	"github.com/apache/incubator-pegasus/go-client/idl/base"
	"github.com/apache/incubator-pegasus/go-client/idl/replication"
	"github.com/apache/thrift/lib/go/thrift"
	"reflect"
)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = context.Background
var _ = reflect.DeepEqual
var _ = bytes.Equal

var _ = replication.GoUnusedProtection__
var _ = base.GoUnusedProtection__

type FilterType int64

const (
	FilterType_FT_NO_FILTER      FilterType = 0
	FilterType_FT_MATCH_ANYWHERE FilterType = 1
	FilterType_FT_MATCH_PREFIX   FilterType = 2
	FilterType_FT_MATCH_POSTFIX  FilterType = 3
)

func (p FilterType) String() string {
	switch p {
	case FilterType_FT_NO_FILTER:
		return "FT_NO_FILTER"
	case FilterType_FT_MATCH_ANYWHERE:
		return "FT_MATCH_ANYWHERE"
	case FilterType_FT_MATCH_PREFIX:
		return "FT_MATCH_PREFIX"
	case FilterType_FT_MATCH_POSTFIX:
		return "FT_MATCH_POSTFIX"
	}
	return "<UNSET>"
}

func FilterTypeFromString(s string) (FilterType, error) {
	switch s {
	case "FT_NO_FILTER":
		return FilterType_FT_NO_FILTER, nil
	case "FT_MATCH_ANYWHERE":
		return FilterType_FT_MATCH_ANYWHERE, nil
	case "FT_MATCH_PREFIX":
		return FilterType_FT_MATCH_PREFIX, nil
	case "FT_MATCH_POSTFIX":
		return FilterType_FT_MATCH_POSTFIX, nil
	}
	return FilterType(0), fmt.Errorf("not a valid FilterType string")
}

func FilterTypePtr(v FilterType) *FilterType { return &v }

func (p FilterType) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *FilterType) UnmarshalText(text []byte) error {
	q, err := FilterTypeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

func (p *FilterType) Scan(value interface{}) error {
	v, ok := value.(int64)
	if !ok {
		return errors.New("Scan value is not int64")
	}
	*p = FilterType(v)
	return nil
}

func (p *FilterType) Value() (driver.Value, error) {
	if p == nil {
		return nil, nil
	}
	return int64(*p), nil
}

type CasCheckType int64

const (
	CasCheckType_CT_NO_CHECK                     CasCheckType = 0
	CasCheckType_CT_VALUE_NOT_EXIST              CasCheckType = 1
	CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY     CasCheckType = 2
	CasCheckType_CT_VALUE_EXIST                  CasCheckType = 3
	CasCheckType_CT_VALUE_NOT_EMPTY              CasCheckType = 4
	CasCheckType_CT_VALUE_MATCH_ANYWHERE         CasCheckType = 5
	CasCheckType_CT_VALUE_MATCH_PREFIX           CasCheckType = 6
	CasCheckType_CT_VALUE_MATCH_POSTFIX          CasCheckType = 7
	CasCheckType_CT_VALUE_BYTES_LESS             CasCheckType = 8
	CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL    CasCheckType = 9
	CasCheckType_CT_VALUE_BYTES_EQUAL            CasCheckType = 10
	CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL CasCheckType = 11
	CasCheckType_CT_VALUE_BYTES_GREATER          CasCheckType = 12
	CasCheckType_CT_VALUE_INT_LESS               CasCheckType = 13
	CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL      CasCheckType = 14
	CasCheckType_CT_VALUE_INT_EQUAL              CasCheckType = 15
	CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL   CasCheckType = 16
	CasCheckType_CT_VALUE_INT_GREATER            CasCheckType = 17
)

func (p CasCheckType) String() string {
	switch p {
	case CasCheckType_CT_NO_CHECK:
		return "CT_NO_CHECK"
	case CasCheckType_CT_VALUE_NOT_EXIST:
		return "CT_VALUE_NOT_EXIST"
	case CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY:
		return "CT_VALUE_NOT_EXIST_OR_EMPTY"
	case CasCheckType_CT_VALUE_EXIST:
		return "CT_VALUE_EXIST"
	case CasCheckType_CT_VALUE_NOT_EMPTY:
		return "CT_VALUE_NOT_EMPTY"
	case CasCheckType_CT_VALUE_MATCH_ANYWHERE:
		return "CT_VALUE_MATCH_ANYWHERE"
	case CasCheckType_CT_VALUE_MATCH_PREFIX:
		return "CT_VALUE_MATCH_PREFIX"
	case CasCheckType_CT_VALUE_MATCH_POSTFIX:
		return "CT_VALUE_MATCH_POSTFIX"
	case CasCheckType_CT_VALUE_BYTES_LESS:
		return "CT_VALUE_BYTES_LESS"
	case CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL:
		return "CT_VALUE_BYTES_LESS_OR_EQUAL"
	case CasCheckType_CT_VALUE_BYTES_EQUAL:
		return "CT_VALUE_BYTES_EQUAL"
	case CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL:
		return "CT_VALUE_BYTES_GREATER_OR_EQUAL"
	case CasCheckType_CT_VALUE_BYTES_GREATER:
		return "CT_VALUE_BYTES_GREATER"
	case CasCheckType_CT_VALUE_INT_LESS:
		return "CT_VALUE_INT_LESS"
	case CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL:
		return "CT_VALUE_INT_LESS_OR_EQUAL"
	case CasCheckType_CT_VALUE_INT_EQUAL:
		return "CT_VALUE_INT_EQUAL"
	case CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL:
		return "CT_VALUE_INT_GREATER_OR_EQUAL"
	case CasCheckType_CT_VALUE_INT_GREATER:
		return "CT_VALUE_INT_GREATER"
	}
	return "<UNSET>"
}

func CasCheckTypeFromString(s string) (CasCheckType, error) {
	switch s {
	case "CT_NO_CHECK":
		return CasCheckType_CT_NO_CHECK, nil
	case "CT_VALUE_NOT_EXIST":
		return CasCheckType_CT_VALUE_NOT_EXIST, nil
	case "CT_VALUE_NOT_EXIST_OR_EMPTY":
		return CasCheckType_CT_VALUE_NOT_EXIST_OR_EMPTY, nil
	case "CT_VALUE_EXIST":
		return CasCheckType_CT_VALUE_EXIST, nil
	case "CT_VALUE_NOT_EMPTY":
		return CasCheckType_CT_VALUE_NOT_EMPTY, nil
	case "CT_VALUE_MATCH_ANYWHERE":
		return CasCheckType_CT_VALUE_MATCH_ANYWHERE, nil
	case "CT_VALUE_MATCH_PREFIX":
		return CasCheckType_CT_VALUE_MATCH_PREFIX, nil
	case "CT_VALUE_MATCH_POSTFIX":
		return CasCheckType_CT_VALUE_MATCH_POSTFIX, nil
	case "CT_VALUE_BYTES_LESS":
		return CasCheckType_CT_VALUE_BYTES_LESS, nil
	case "CT_VALUE_BYTES_LESS_OR_EQUAL":
		return CasCheckType_CT_VALUE_BYTES_LESS_OR_EQUAL, nil
	case "CT_VALUE_BYTES_EQUAL":
		return CasCheckType_CT_VALUE_BYTES_EQUAL, nil
	case "CT_VALUE_BYTES_GREATER_OR_EQUAL":
		return CasCheckType_CT_VALUE_BYTES_GREATER_OR_EQUAL, nil
	case "CT_VALUE_BYTES_GREATER":
		return CasCheckType_CT_VALUE_BYTES_GREATER, nil
	case "CT_VALUE_INT_LESS":
		return CasCheckType_CT_VALUE_INT_LESS, nil
	case "CT_VALUE_INT_LESS_OR_EQUAL":
		return CasCheckType_CT_VALUE_INT_LESS_OR_EQUAL, nil
	case "CT_VALUE_INT_EQUAL":
		return CasCheckType_CT_VALUE_INT_EQUAL, nil
	case "CT_VALUE_INT_GREATER_OR_EQUAL":
		return CasCheckType_CT_VALUE_INT_GREATER_OR_EQUAL, nil
	case "CT_VALUE_INT_GREATER":
		return CasCheckType_CT_VALUE_INT_GREATER, nil
	}
	return CasCheckType(0), fmt.Errorf("not a valid CasCheckType string")
}

func CasCheckTypePtr(v CasCheckType) *CasCheckType { return &v }

func (p CasCheckType) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *CasCheckType) UnmarshalText(text []byte) error {
	q, err := CasCheckTypeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

func (p *CasCheckType) Scan(value interface{}) error {
	v, ok := value.(int64)
	if !ok {
		return errors.New("Scan value is not int64")
	}
	*p = CasCheckType(v)
	return nil
}

func (p *CasCheckType) Value() (driver.Value, error) {
	if p == nil {
		return nil, nil
	}
	return int64(*p), nil
}

type MutateOperation int64

const (
	MutateOperation_MO_PUT    MutateOperation = 0
	MutateOperation_MO_DELETE MutateOperation = 1
)

func (p MutateOperation) String() string {
	switch p {
	case MutateOperation_MO_PUT:
		return "MO_PUT"
	case MutateOperation_MO_DELETE:
		return "MO_DELETE"
	}
	return "<UNSET>"
}

func MutateOperationFromString(s string) (MutateOperation, error) {
	switch s {
	case "MO_PUT":
		return MutateOperation_MO_PUT, nil
	case "MO_DELETE":
		return MutateOperation_MO_DELETE, nil
	}
	return MutateOperation(0), fmt.Errorf("not a valid MutateOperation string")
}

func MutateOperationPtr(v MutateOperation) *MutateOperation { return &v }

func (p MutateOperation) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *MutateOperation) UnmarshalText(text []byte) error {
	q, err := MutateOperationFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

func (p *MutateOperation) Scan(value interface{}) error {
	v, ok := value.(int64)
	if !ok {
		return errors.New("Scan value is not int64")
	}
	*p = MutateOperation(v)
	return nil
}

func (p *MutateOperation) Value() (driver.Value, error) {
	if p == nil {
		return nil, nil
	}
	return int64(*p), nil
}

type UpdateType int64

const (
	UpdateType_UT_PUT                     UpdateType = 0
	UpdateType_UT_INCR                    UpdateType = 1
	UpdateType_UT_CHECK_AND_SET           UpdateType = 2
	UpdateType_UT_CHECK_AND_MUTATE_PUT    UpdateType = 3
	UpdateType_UT_CHECK_AND_MUTATE_REMOVE UpdateType = 4
)

func (p UpdateType) String() string {
	switch p {
	case UpdateType_UT_PUT:
		return "UT_PUT"
	case UpdateType_UT_INCR:
		return "UT_INCR"
	case UpdateType_UT_CHECK_AND_SET:
		return "UT_CHECK_AND_SET"
	case UpdateType_UT_CHECK_AND_MUTATE_PUT:
		return "UT_CHECK_AND_MUTATE_PUT"
	case UpdateType_UT_CHECK_AND_MUTATE_REMOVE:
		return "UT_CHECK_AND_MUTATE_REMOVE"
	}
	return "<UNSET>"
}

func UpdateTypeFromString(s string) (UpdateType, error) {
	switch s {
	case "UT_PUT":
		return UpdateType_UT_PUT, nil
	case "UT_INCR":
		return UpdateType_UT_INCR, nil
	case "UT_CHECK_AND_SET":
		return UpdateType_UT_CHECK_AND_SET, nil
	case "UT_CHECK_AND_MUTATE_PUT":
		return UpdateType_UT_CHECK_AND_MUTATE_PUT, nil
	case "UT_CHECK_AND_MUTATE_REMOVE":
		return UpdateType_UT_CHECK_AND_MUTATE_REMOVE, nil
	}
	return UpdateType(0), fmt.Errorf("not a valid UpdateType string")
}

func UpdateTypePtr(v UpdateType) *UpdateType { return &v }

func (p UpdateType) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *UpdateType) UnmarshalText(text []byte) error {
	q, err := UpdateTypeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

func (p *UpdateType) Scan(value interface{}) error {
	v, ok := value.(int64)
	if !ok {
		return errors.New("Scan value is not int64")
	}
	*p = UpdateType(v)
	return nil
}

func (p *UpdateType) Value() (driver.Value, error) {
	if p == nil {
		return nil, nil
	}
	return int64(*p), nil
}

// Attributes:
//  - Key
//  - Value
//  - ExpireTsSeconds
//  - Type
//  - CheckValueReturned
//  - CheckValueExist
//  - CheckValue
type UpdateRequest struct {
	Key                *base.Blob  `thrift:"key,1" db:"key" json:"key"`
	Value              *base.Blob  `thrift:"value,2" db:"value" json:"value"`
	ExpireTsSeconds    int32       `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"`
	Type               *UpdateType `thrift:"type,4" db:"type" json:"type,omitempty"`
	CheckValueReturned *bool       `thrift:"check_value_returned,5" db:"check_value_returned" json:"check_value_returned,omitempty"`
	CheckValueExist    *bool       `thrift:"check_value_exist,6" db:"check_value_exist" json:"check_value_exist,omitempty"`
	CheckValue         *base.Blob  `thrift:"check_value,7" db:"check_value" json:"check_value,omitempty"`
}

func NewUpdateRequest() *UpdateRequest {
	return &UpdateRequest{}
}

var UpdateRequest_Key_DEFAULT *base.Blob

func (p *UpdateRequest) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return UpdateRequest_Key_DEFAULT
	}
	return p.Key
}

var UpdateRequest_Value_DEFAULT *base.Blob

func (p *UpdateRequest) GetValue() *base.Blob {
	if !p.IsSetValue() {
		return UpdateRequest_Value_DEFAULT
	}
	return p.Value
}

func (p *UpdateRequest) GetExpireTsSeconds() int32 {
	return p.ExpireTsSeconds
}

var UpdateRequest_Type_DEFAULT UpdateType

func (p *UpdateRequest) GetType() UpdateType {
	if !p.IsSetType() {
		return UpdateRequest_Type_DEFAULT
	}
	return *p.Type
}

var UpdateRequest_CheckValueReturned_DEFAULT bool

func (p *UpdateRequest) GetCheckValueReturned() bool {
	if !p.IsSetCheckValueReturned() {
		return UpdateRequest_CheckValueReturned_DEFAULT
	}
	return *p.CheckValueReturned
}

var UpdateRequest_CheckValueExist_DEFAULT bool

func (p *UpdateRequest) GetCheckValueExist() bool {
	if !p.IsSetCheckValueExist() {
		return UpdateRequest_CheckValueExist_DEFAULT
	}
	return *p.CheckValueExist
}

var UpdateRequest_CheckValue_DEFAULT *base.Blob

func (p *UpdateRequest) GetCheckValue() *base.Blob {
	if !p.IsSetCheckValue() {
		return UpdateRequest_CheckValue_DEFAULT
	}
	return p.CheckValue
}
func (p *UpdateRequest) IsSetKey() bool {
	return p.Key != nil
}

func (p *UpdateRequest) IsSetValue() bool {
	return p.Value != nil
}

func (p *UpdateRequest) IsSetType() bool {
	return p.Type != nil
}

func (p *UpdateRequest) IsSetCheckValueReturned() bool {
	return p.CheckValueReturned != nil
}

func (p *UpdateRequest) IsSetCheckValueExist() bool {
	return p.CheckValueExist != nil
}

func (p *UpdateRequest) IsSetCheckValue() bool {
	return p.CheckValue != nil
}

func (p *UpdateRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *UpdateRequest) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *UpdateRequest) ReadField2(iprot thrift.TProtocol) error {
	p.Value = &base.Blob{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *UpdateRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ExpireTsSeconds = v
	}
	return nil
}

func (p *UpdateRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		temp := UpdateType(v)
		p.Type = &temp
	}
	return nil
}

func (p *UpdateRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.CheckValueReturned = &v
	}
	return nil
}

func (p *UpdateRequest) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.CheckValueExist = &v
	}
	return nil
}

func (p *UpdateRequest) ReadField7(iprot thrift.TProtocol) error {
	p.CheckValue = &base.Blob{}
	if err := p.CheckValue.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckValue), err)
	}
	return nil
}

func (p *UpdateRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("update_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *UpdateRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *UpdateRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
	}
	if err := p.Value.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
	}
	return err
}

func (p *UpdateRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err)
	}
	return err
}

func (p *UpdateRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetType() {
		if err := oprot.WriteFieldBegin("type", thrift.I32, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:type: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.Type)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.type (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:type: ", p), err)
		}
	}
	return err
}

func (p *UpdateRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetCheckValueReturned() {
		if err := oprot.WriteFieldBegin("check_value_returned", thrift.BOOL, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:check_value_returned: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.CheckValueReturned)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.check_value_returned (5) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:check_value_returned: ", p), err)
		}
	}
	return err
}

func (p *UpdateRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetCheckValueExist() {
		if err := oprot.WriteFieldBegin("check_value_exist", thrift.BOOL, 6); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:check_value_exist: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.CheckValueExist)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.check_value_exist (6) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 6:check_value_exist: ", p), err)
		}
	}
	return err
}

func (p *UpdateRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetCheckValue() {
		if err := oprot.WriteFieldBegin("check_value", thrift.STRUCT, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:check_value: ", p), err)
		}
		if err := p.CheckValue.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckValue), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:check_value: ", p), err)
		}
	}
	return err
}

func (p *UpdateRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("UpdateRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - AppID
//  - PartitionIndex
//  - Decree
//  - Server
type UpdateResponse struct {
	Error          int32  `thrift:"error,1" db:"error" json:"error"`
	AppID          int32  `thrift:"app_id,2" db:"app_id" json:"app_id"`
	PartitionIndex int32  `thrift:"partition_index,3" db:"partition_index" json:"partition_index"`
	Decree         int64  `thrift:"decree,4" db:"decree" json:"decree"`
	Server         string `thrift:"server,5" db:"server" json:"server"`
}

func NewUpdateResponse() *UpdateResponse {
	return &UpdateResponse{}
}

func (p *UpdateResponse) GetError() int32 {
	return p.Error
}

func (p *UpdateResponse) GetAppID() int32 {
	return p.AppID
}

func (p *UpdateResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *UpdateResponse) GetDecree() int64 {
	return p.Decree
}

func (p *UpdateResponse) GetServer() string {
	return p.Server
}
func (p *UpdateResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *UpdateResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *UpdateResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *UpdateResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *UpdateResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.Decree = v
	}
	return nil
}

func (p *UpdateResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *UpdateResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("update_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *UpdateResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *UpdateResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:app_id: ", p), err)
	}
	return err
}

func (p *UpdateResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:partition_index: ", p), err)
	}
	return err
}

func (p *UpdateResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("decree", thrift.I64, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:decree: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Decree)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.decree (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:decree: ", p), err)
	}
	return err
}

func (p *UpdateResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:server: ", p), err)
	}
	return err
}

func (p *UpdateResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("UpdateResponse(%+v)", *p)
}

// Attributes:
//  - Error
//  - Value
//  - AppID
//  - PartitionIndex
//  - Server
type ReadResponse struct {
	Error          int32      `thrift:"error,1" db:"error" json:"error"`
	Value          *base.Blob `thrift:"value,2" db:"value" json:"value"`
	AppID          int32      `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32      `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	// unused field # 5
	Server string `thrift:"server,6" db:"server" json:"server"`
}

func NewReadResponse() *ReadResponse {
	return &ReadResponse{}
}

func (p *ReadResponse) GetError() int32 {
	return p.Error
}

var ReadResponse_Value_DEFAULT *base.Blob

func (p *ReadResponse) GetValue() *base.Blob {
	if !p.IsSetValue() {
		return ReadResponse_Value_DEFAULT
	}
	return p.Value
}

func (p *ReadResponse) GetAppID() int32 {
	return p.AppID
}

func (p *ReadResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *ReadResponse) GetServer() string {
	return p.Server
}
func (p *ReadResponse) IsSetValue() bool {
	return p.Value != nil
}

func (p *ReadResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ReadResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *ReadResponse) ReadField2(iprot thrift.TProtocol) error {
	p.Value = &base.Blob{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *ReadResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *ReadResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *ReadResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *ReadResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("read_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ReadResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *ReadResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
	}
	if err := p.Value.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
	}
	return err
}

func (p *ReadResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *ReadResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *ReadResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *ReadResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ReadResponse(%+v)", *p)
}

// Attributes:
//  - Error
//  - TTLSeconds
//  - AppID
//  - PartitionIndex
//  - Server
type TTLResponse struct {
	Error          int32 `thrift:"error,1" db:"error" json:"error"`
	TTLSeconds     int32 `thrift:"ttl_seconds,2" db:"ttl_seconds" json:"ttl_seconds"`
	AppID          int32 `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	// unused field # 5
	Server string `thrift:"server,6" db:"server" json:"server"`
}

func NewTTLResponse() *TTLResponse {
	return &TTLResponse{}
}

func (p *TTLResponse) GetError() int32 {
	return p.Error
}

func (p *TTLResponse) GetTTLSeconds() int32 {
	return p.TTLSeconds
}

func (p *TTLResponse) GetAppID() int32 {
	return p.AppID
}

func (p *TTLResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *TTLResponse) GetServer() string {
	return p.Server
}
func (p *TTLResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TTLResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *TTLResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.TTLSeconds = v
	}
	return nil
}

func (p *TTLResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *TTLResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *TTLResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *TTLResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ttl_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TTLResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *TTLResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("ttl_seconds", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ttl_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.TTLSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.ttl_seconds (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_seconds: ", p), err)
	}
	return err
}

func (p *TTLResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *TTLResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *TTLResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *TTLResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TTLResponse(%+v)", *p)
}

// Attributes:
//  - Error
//  - Count
//  - AppID
//  - PartitionIndex
//  - Server
type CountResponse struct {
	Error          int32 `thrift:"error,1" db:"error" json:"error"`
	Count          int64 `thrift:"count,2" db:"count" json:"count"`
	AppID          int32 `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32 `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	// unused field # 5
	Server string `thrift:"server,6" db:"server" json:"server"`
}

func NewCountResponse() *CountResponse {
	return &CountResponse{}
}

func (p *CountResponse) GetError() int32 {
	return p.Error
}

func (p *CountResponse) GetCount() int64 {
	return p.Count
}

func (p *CountResponse) GetAppID() int32 {
	return p.AppID
}

func (p *CountResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *CountResponse) GetServer() string {
	return p.Server
}
func (p *CountResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *CountResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *CountResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Count = v
	}
	return nil
}

func (p *CountResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *CountResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *CountResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *CountResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("count_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *CountResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *CountResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:count: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Count)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.count (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:count: ", p), err)
	}
	return err
}

func (p *CountResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *CountResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *CountResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *CountResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CountResponse(%+v)", *p)
}

// Attributes:
//  - Key
//  - Value
//  - ExpireTsSeconds
type KeyValue struct {
	Key             *base.Blob `thrift:"key,1" db:"key" json:"key"`
	Value           *base.Blob `thrift:"value,2" db:"value" json:"value"`
	ExpireTsSeconds *int32     `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds,omitempty"`
}

func NewKeyValue() *KeyValue {
	return &KeyValue{}
}

var KeyValue_Key_DEFAULT *base.Blob

func (p *KeyValue) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return KeyValue_Key_DEFAULT
	}
	return p.Key
}

var KeyValue_Value_DEFAULT *base.Blob

func (p *KeyValue) GetValue() *base.Blob {
	if !p.IsSetValue() {
		return KeyValue_Value_DEFAULT
	}
	return p.Value
}

var KeyValue_ExpireTsSeconds_DEFAULT int32

func (p *KeyValue) GetExpireTsSeconds() int32 {
	if !p.IsSetExpireTsSeconds() {
		return KeyValue_ExpireTsSeconds_DEFAULT
	}
	return *p.ExpireTsSeconds
}
func (p *KeyValue) IsSetKey() bool {
	return p.Key != nil
}

func (p *KeyValue) IsSetValue() bool {
	return p.Value != nil
}

func (p *KeyValue) IsSetExpireTsSeconds() bool {
	return p.ExpireTsSeconds != nil
}

func (p *KeyValue) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *KeyValue) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *KeyValue) ReadField2(iprot thrift.TProtocol) error {
	p.Value = &base.Blob{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *KeyValue) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ExpireTsSeconds = &v
	}
	return nil
}

func (p *KeyValue) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("key_value"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *KeyValue) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *KeyValue) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
	}
	if err := p.Value.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
	}
	return err
}

func (p *KeyValue) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetExpireTsSeconds() {
		if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.ExpireTsSeconds)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err)
		}
	}
	return err
}

func (p *KeyValue) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("KeyValue(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - Kvs
//  - ExpireTsSeconds
type MultiPutRequest struct {
	HashKey         *base.Blob  `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	Kvs             []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"`
	ExpireTsSeconds int32       `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"`
}

func NewMultiPutRequest() *MultiPutRequest {
	return &MultiPutRequest{}
}

var MultiPutRequest_HashKey_DEFAULT *base.Blob

func (p *MultiPutRequest) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return MultiPutRequest_HashKey_DEFAULT
	}
	return p.HashKey
}

func (p *MultiPutRequest) GetKvs() []*KeyValue {
	return p.Kvs
}

func (p *MultiPutRequest) GetExpireTsSeconds() int32 {
	return p.ExpireTsSeconds
}
func (p *MultiPutRequest) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *MultiPutRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MultiPutRequest) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *MultiPutRequest) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*KeyValue, 0, size)
	p.Kvs = tSlice
	for i := 0; i < size; i++ {
		_elem0 := &KeyValue{}
		if err := _elem0.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err)
		}
		p.Kvs = append(p.Kvs, _elem0)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *MultiPutRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ExpireTsSeconds = v
	}
	return nil
}

func (p *MultiPutRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_put_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MultiPutRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *MultiPutRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Kvs {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:kvs: ", p), err)
	}
	return err
}

func (p *MultiPutRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err)
	}
	return err
}

func (p *MultiPutRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MultiPutRequest(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - SortKeys
//  - MaxCount
type MultiRemoveRequest struct {
	HashKey  *base.Blob   `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	SortKeys []*base.Blob `thrift:"sort_keys,2" db:"sort_keys" json:"sort_keys"`
	MaxCount int64        `thrift:"max_count,3" db:"max_count" json:"max_count"`
}

func NewMultiRemoveRequest() *MultiRemoveRequest {
	return &MultiRemoveRequest{}
}

var MultiRemoveRequest_HashKey_DEFAULT *base.Blob

func (p *MultiRemoveRequest) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return MultiRemoveRequest_HashKey_DEFAULT
	}
	return p.HashKey
}

func (p *MultiRemoveRequest) GetSortKeys() []*base.Blob {
	return p.SortKeys
}

func (p *MultiRemoveRequest) GetMaxCount() int64 {
	return p.MaxCount
}
func (p *MultiRemoveRequest) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *MultiRemoveRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MultiRemoveRequest) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *MultiRemoveRequest) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*base.Blob, 0, size)
	p.SortKeys = tSlice
	for i := 0; i < size; i++ {
		_elem1 := &base.Blob{}
		if err := _elem1.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err)
		}
		p.SortKeys = append(p.SortKeys, _elem1)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *MultiRemoveRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.MaxCount = v
	}
	return nil
}

func (p *MultiRemoveRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_remove_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MultiRemoveRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *MultiRemoveRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_keys", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_keys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SortKeys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.SortKeys {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_keys: ", p), err)
	}
	return err
}

func (p *MultiRemoveRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("max_count", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_count: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.MaxCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.max_count (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_count: ", p), err)
	}
	return err
}

func (p *MultiRemoveRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MultiRemoveRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - Count
//  - AppID
//  - PartitionIndex
//  - Decree
//  - Server
type MultiRemoveResponse struct {
	Error          int32  `thrift:"error,1" db:"error" json:"error"`
	Count          int64  `thrift:"count,2" db:"count" json:"count"`
	AppID          int32  `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32  `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	Decree         int64  `thrift:"decree,5" db:"decree" json:"decree"`
	Server         string `thrift:"server,6" db:"server" json:"server"`
}

func NewMultiRemoveResponse() *MultiRemoveResponse {
	return &MultiRemoveResponse{}
}

func (p *MultiRemoveResponse) GetError() int32 {
	return p.Error
}

func (p *MultiRemoveResponse) GetCount() int64 {
	return p.Count
}

func (p *MultiRemoveResponse) GetAppID() int32 {
	return p.AppID
}

func (p *MultiRemoveResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *MultiRemoveResponse) GetDecree() int64 {
	return p.Decree
}

func (p *MultiRemoveResponse) GetServer() string {
	return p.Server
}
func (p *MultiRemoveResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Count = v
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.Decree = v
	}
	return nil
}

func (p *MultiRemoveResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *MultiRemoveResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_remove_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MultiRemoveResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:count: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Count)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.count (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:count: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("decree", thrift.I64, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:decree: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Decree)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.decree (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:decree: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *MultiRemoveResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MultiRemoveResponse(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - SortKeys
//  - MaxKvCount
//  - MaxKvSize
//  - NoValue
//  - StartSortkey
//  - StopSortkey
//  - StartInclusive
//  - StopInclusive
//  - SortKeyFilterType
//  - SortKeyFilterPattern
//  - Reverse
type MultiGetRequest struct {
	HashKey              *base.Blob   `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	SortKeys             []*base.Blob `thrift:"sort_keys,2" db:"sort_keys" json:"sort_keys"`
	MaxKvCount           int32        `thrift:"max_kv_count,3" db:"max_kv_count" json:"max_kv_count"`
	MaxKvSize            int32        `thrift:"max_kv_size,4" db:"max_kv_size" json:"max_kv_size"`
	NoValue              bool         `thrift:"no_value,5" db:"no_value" json:"no_value"`
	StartSortkey         *base.Blob   `thrift:"start_sortkey,6" db:"start_sortkey" json:"start_sortkey"`
	StopSortkey          *base.Blob   `thrift:"stop_sortkey,7" db:"stop_sortkey" json:"stop_sortkey"`
	StartInclusive       bool         `thrift:"start_inclusive,8" db:"start_inclusive" json:"start_inclusive"`
	StopInclusive        bool         `thrift:"stop_inclusive,9" db:"stop_inclusive" json:"stop_inclusive"`
	SortKeyFilterType    FilterType   `thrift:"sort_key_filter_type,10" db:"sort_key_filter_type" json:"sort_key_filter_type"`
	SortKeyFilterPattern *base.Blob   `thrift:"sort_key_filter_pattern,11" db:"sort_key_filter_pattern" json:"sort_key_filter_pattern"`
	Reverse              bool         `thrift:"reverse,12" db:"reverse" json:"reverse"`
}

func NewMultiGetRequest() *MultiGetRequest {
	return &MultiGetRequest{}
}

var MultiGetRequest_HashKey_DEFAULT *base.Blob

func (p *MultiGetRequest) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return MultiGetRequest_HashKey_DEFAULT
	}
	return p.HashKey
}

func (p *MultiGetRequest) GetSortKeys() []*base.Blob {
	return p.SortKeys
}

func (p *MultiGetRequest) GetMaxKvCount() int32 {
	return p.MaxKvCount
}

func (p *MultiGetRequest) GetMaxKvSize() int32 {
	return p.MaxKvSize
}

func (p *MultiGetRequest) GetNoValue() bool {
	return p.NoValue
}

var MultiGetRequest_StartSortkey_DEFAULT *base.Blob

func (p *MultiGetRequest) GetStartSortkey() *base.Blob {
	if !p.IsSetStartSortkey() {
		return MultiGetRequest_StartSortkey_DEFAULT
	}
	return p.StartSortkey
}

var MultiGetRequest_StopSortkey_DEFAULT *base.Blob

func (p *MultiGetRequest) GetStopSortkey() *base.Blob {
	if !p.IsSetStopSortkey() {
		return MultiGetRequest_StopSortkey_DEFAULT
	}
	return p.StopSortkey
}

func (p *MultiGetRequest) GetStartInclusive() bool {
	return p.StartInclusive
}

func (p *MultiGetRequest) GetStopInclusive() bool {
	return p.StopInclusive
}

func (p *MultiGetRequest) GetSortKeyFilterType() FilterType {
	return p.SortKeyFilterType
}

var MultiGetRequest_SortKeyFilterPattern_DEFAULT *base.Blob

func (p *MultiGetRequest) GetSortKeyFilterPattern() *base.Blob {
	if !p.IsSetSortKeyFilterPattern() {
		return MultiGetRequest_SortKeyFilterPattern_DEFAULT
	}
	return p.SortKeyFilterPattern
}

func (p *MultiGetRequest) GetReverse() bool {
	return p.Reverse
}
func (p *MultiGetRequest) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *MultiGetRequest) IsSetStartSortkey() bool {
	return p.StartSortkey != nil
}

func (p *MultiGetRequest) IsSetStopSortkey() bool {
	return p.StopSortkey != nil
}

func (p *MultiGetRequest) IsSetSortKeyFilterPattern() bool {
	return p.SortKeyFilterPattern != nil
}

func (p *MultiGetRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 8:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField8(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 9:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField9(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 10:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField10(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 11:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField11(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 12:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField12(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*base.Blob, 0, size)
	p.SortKeys = tSlice
	for i := 0; i < size; i++ {
		_elem2 := &base.Blob{}
		if err := _elem2.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err)
		}
		p.SortKeys = append(p.SortKeys, _elem2)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.MaxKvCount = v
	}
	return nil
}

func (p *MultiGetRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.MaxKvSize = v
	}
	return nil
}

func (p *MultiGetRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.NoValue = v
	}
	return nil
}

func (p *MultiGetRequest) ReadField6(iprot thrift.TProtocol) error {
	p.StartSortkey = &base.Blob{}
	if err := p.StartSortkey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartSortkey), err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField7(iprot thrift.TProtocol) error {
	p.StopSortkey = &base.Blob{}
	if err := p.StopSortkey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StopSortkey), err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.StartInclusive = v
	}
	return nil
}

func (p *MultiGetRequest) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		p.StopInclusive = v
	}
	return nil
}

func (p *MultiGetRequest) ReadField10(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 10: ", err)
	} else {
		temp := FilterType(v)
		p.SortKeyFilterType = temp
	}
	return nil
}

func (p *MultiGetRequest) ReadField11(iprot thrift.TProtocol) error {
	p.SortKeyFilterPattern = &base.Blob{}
	if err := p.SortKeyFilterPattern.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKeyFilterPattern), err)
	}
	return nil
}

func (p *MultiGetRequest) ReadField12(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 12: ", err)
	} else {
		p.Reverse = v
	}
	return nil
}

func (p *MultiGetRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_get_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
		if err := p.writeField8(oprot); err != nil {
			return err
		}
		if err := p.writeField9(oprot); err != nil {
			return err
		}
		if err := p.writeField10(oprot); err != nil {
			return err
		}
		if err := p.writeField11(oprot); err != nil {
			return err
		}
		if err := p.writeField12(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MultiGetRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_keys", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_keys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SortKeys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.SortKeys {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_keys: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("max_kv_count", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_kv_count: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxKvCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.max_kv_count (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_kv_count: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("max_kv_size", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_kv_size: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxKvSize)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.max_kv_size (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_kv_size: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("no_value", thrift.BOOL, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:no_value: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.NoValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.no_value (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:no_value: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_sortkey", thrift.STRUCT, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_sortkey: ", p), err)
	}
	if err := p.StartSortkey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartSortkey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_sortkey: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("stop_sortkey", thrift.STRUCT, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_sortkey: ", p), err)
	}
	if err := p.StopSortkey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StopSortkey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_sortkey: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_inclusive", thrift.BOOL, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:start_inclusive: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.StartInclusive)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.start_inclusive (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:start_inclusive: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("stop_inclusive", thrift.BOOL, 9); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:stop_inclusive: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.StopInclusive)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.stop_inclusive (9) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 9:stop_inclusive: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key_filter_type", thrift.I32, 10); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:sort_key_filter_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.SortKeyFilterType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.sort_key_filter_type (10) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 10:sort_key_filter_type: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField11(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key_filter_pattern", thrift.STRUCT, 11); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:sort_key_filter_pattern: ", p), err)
	}
	if err := p.SortKeyFilterPattern.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKeyFilterPattern), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 11:sort_key_filter_pattern: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) writeField12(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("reverse", thrift.BOOL, 12); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:reverse: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.Reverse)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.reverse (12) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 12:reverse: ", p), err)
	}
	return err
}

func (p *MultiGetRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MultiGetRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - Kvs
//  - AppID
//  - PartitionIndex
//  - Server
type MultiGetResponse struct {
	Error          int32       `thrift:"error,1" db:"error" json:"error"`
	Kvs            []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"`
	AppID          int32       `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32       `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	// unused field # 5
	Server string `thrift:"server,6" db:"server" json:"server"`
}

func NewMultiGetResponse() *MultiGetResponse {
	return &MultiGetResponse{}
}

func (p *MultiGetResponse) GetError() int32 {
	return p.Error
}

func (p *MultiGetResponse) GetKvs() []*KeyValue {
	return p.Kvs
}

func (p *MultiGetResponse) GetAppID() int32 {
	return p.AppID
}

func (p *MultiGetResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *MultiGetResponse) GetServer() string {
	return p.Server
}
func (p *MultiGetResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MultiGetResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *MultiGetResponse) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*KeyValue, 0, size)
	p.Kvs = tSlice
	for i := 0; i < size; i++ {
		_elem3 := &KeyValue{}
		if err := _elem3.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err)
		}
		p.Kvs = append(p.Kvs, _elem3)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *MultiGetResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *MultiGetResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *MultiGetResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *MultiGetResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_get_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MultiGetResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *MultiGetResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Kvs {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:kvs: ", p), err)
	}
	return err
}

func (p *MultiGetResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *MultiGetResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *MultiGetResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *MultiGetResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MultiGetResponse(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - SortKey
type FullKey struct {
	HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	SortKey *base.Blob `thrift:"sort_key,2" db:"sort_key" json:"sort_key"`
}

func NewFullKey() *FullKey {
	return &FullKey{}
}

var FullKey_HashKey_DEFAULT *base.Blob

func (p *FullKey) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return FullKey_HashKey_DEFAULT
	}
	return p.HashKey
}

var FullKey_SortKey_DEFAULT *base.Blob

func (p *FullKey) GetSortKey() *base.Blob {
	if !p.IsSetSortKey() {
		return FullKey_SortKey_DEFAULT
	}
	return p.SortKey
}
func (p *FullKey) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *FullKey) IsSetSortKey() bool {
	return p.SortKey != nil
}

func (p *FullKey) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *FullKey) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *FullKey) ReadField2(iprot thrift.TProtocol) error {
	p.SortKey = &base.Blob{}
	if err := p.SortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err)
	}
	return nil
}

func (p *FullKey) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("full_key"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *FullKey) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *FullKey) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err)
	}
	if err := p.SortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err)
	}
	return err
}

func (p *FullKey) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("FullKey(%+v)", *p)
}

// Attributes:
//  - Keys
type BatchGetRequest struct {
	Keys []*FullKey `thrift:"keys,1" db:"keys" json:"keys"`
}

func NewBatchGetRequest() *BatchGetRequest {
	return &BatchGetRequest{}
}

func (p *BatchGetRequest) GetKeys() []*FullKey {
	return p.Keys
}
func (p *BatchGetRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *BatchGetRequest) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*FullKey, 0, size)
	p.Keys = tSlice
	for i := 0; i < size; i++ {
		_elem4 := &FullKey{}
		if err := _elem4.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err)
		}
		p.Keys = append(p.Keys, _elem4)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *BatchGetRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("batch_get_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *BatchGetRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("keys", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Keys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Keys {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keys: ", p), err)
	}
	return err
}

func (p *BatchGetRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("BatchGetRequest(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - SortKey
//  - Value
type FullData struct {
	HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	SortKey *base.Blob `thrift:"sort_key,2" db:"sort_key" json:"sort_key"`
	Value   *base.Blob `thrift:"value,3" db:"value" json:"value"`
}

func NewFullData() *FullData {
	return &FullData{}
}

var FullData_HashKey_DEFAULT *base.Blob

func (p *FullData) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return FullData_HashKey_DEFAULT
	}
	return p.HashKey
}

var FullData_SortKey_DEFAULT *base.Blob

func (p *FullData) GetSortKey() *base.Blob {
	if !p.IsSetSortKey() {
		return FullData_SortKey_DEFAULT
	}
	return p.SortKey
}

var FullData_Value_DEFAULT *base.Blob

func (p *FullData) GetValue() *base.Blob {
	if !p.IsSetValue() {
		return FullData_Value_DEFAULT
	}
	return p.Value
}
func (p *FullData) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *FullData) IsSetSortKey() bool {
	return p.SortKey != nil
}

func (p *FullData) IsSetValue() bool {
	return p.Value != nil
}

func (p *FullData) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *FullData) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *FullData) ReadField2(iprot thrift.TProtocol) error {
	p.SortKey = &base.Blob{}
	if err := p.SortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err)
	}
	return nil
}

func (p *FullData) ReadField3(iprot thrift.TProtocol) error {
	p.Value = &base.Blob{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *FullData) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("full_data"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *FullData) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *FullData) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err)
	}
	if err := p.SortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err)
	}
	return err
}

func (p *FullData) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err)
	}
	if err := p.Value.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err)
	}
	return err
}

func (p *FullData) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("FullData(%+v)", *p)
}

// Attributes:
//  - Error
//  - Data
//  - AppID
//  - PartitionIndex
//  - Server
type BatchGetResponse struct {
	Error          int32       `thrift:"error,1" db:"error" json:"error"`
	Data           []*FullData `thrift:"data,2" db:"data" json:"data"`
	AppID          int32       `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32       `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	// unused field # 5
	Server string `thrift:"server,6" db:"server" json:"server"`
}

func NewBatchGetResponse() *BatchGetResponse {
	return &BatchGetResponse{}
}

func (p *BatchGetResponse) GetError() int32 {
	return p.Error
}

func (p *BatchGetResponse) GetData() []*FullData {
	return p.Data
}

func (p *BatchGetResponse) GetAppID() int32 {
	return p.AppID
}

func (p *BatchGetResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *BatchGetResponse) GetServer() string {
	return p.Server
}
func (p *BatchGetResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *BatchGetResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *BatchGetResponse) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*FullData, 0, size)
	p.Data = tSlice
	for i := 0; i < size; i++ {
		_elem5 := &FullData{}
		if err := _elem5.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err)
		}
		p.Data = append(p.Data, _elem5)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *BatchGetResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *BatchGetResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *BatchGetResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *BatchGetResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("batch_get_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *BatchGetResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *BatchGetResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Data)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Data {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err)
	}
	return err
}

func (p *BatchGetResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *BatchGetResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *BatchGetResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *BatchGetResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("BatchGetResponse(%+v)", *p)
}

// Attributes:
//  - Key
//  - Increment
//  - ExpireTsSeconds
type IncrRequest struct {
	Key             *base.Blob `thrift:"key,1" db:"key" json:"key"`
	Increment       int64      `thrift:"increment,2" db:"increment" json:"increment"`
	ExpireTsSeconds int32      `thrift:"expire_ts_seconds,3" db:"expire_ts_seconds" json:"expire_ts_seconds"`
}

func NewIncrRequest() *IncrRequest {
	return &IncrRequest{}
}

var IncrRequest_Key_DEFAULT *base.Blob

func (p *IncrRequest) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return IncrRequest_Key_DEFAULT
	}
	return p.Key
}

func (p *IncrRequest) GetIncrement() int64 {
	return p.Increment
}

func (p *IncrRequest) GetExpireTsSeconds() int32 {
	return p.ExpireTsSeconds
}
func (p *IncrRequest) IsSetKey() bool {
	return p.Key != nil
}

func (p *IncrRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *IncrRequest) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *IncrRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Increment = v
	}
	return nil
}

func (p *IncrRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ExpireTsSeconds = v
	}
	return nil
}

func (p *IncrRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("incr_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *IncrRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *IncrRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("increment", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:increment: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Increment)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.increment (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:increment: ", p), err)
	}
	return err
}

func (p *IncrRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("expire_ts_seconds", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:expire_ts_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.ExpireTsSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.expire_ts_seconds (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:expire_ts_seconds: ", p), err)
	}
	return err
}

func (p *IncrRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IncrRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - NewValue_
//  - AppID
//  - PartitionIndex
//  - Decree
//  - Server
type IncrResponse struct {
	Error          int32  `thrift:"error,1" db:"error" json:"error"`
	NewValue_      int64  `thrift:"new_value,2" db:"new_value" json:"new_value"`
	AppID          int32  `thrift:"app_id,3" db:"app_id" json:"app_id"`
	PartitionIndex int32  `thrift:"partition_index,4" db:"partition_index" json:"partition_index"`
	Decree         int64  `thrift:"decree,5" db:"decree" json:"decree"`
	Server         string `thrift:"server,6" db:"server" json:"server"`
}

func NewIncrResponse() *IncrResponse {
	return &IncrResponse{}
}

func (p *IncrResponse) GetError() int32 {
	return p.Error
}

func (p *IncrResponse) GetNewValue_() int64 {
	return p.NewValue_
}

func (p *IncrResponse) GetAppID() int32 {
	return p.AppID
}

func (p *IncrResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *IncrResponse) GetDecree() int64 {
	return p.Decree
}

func (p *IncrResponse) GetServer() string {
	return p.Server
}
func (p *IncrResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *IncrResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *IncrResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.NewValue_ = v
	}
	return nil
}

func (p *IncrResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *IncrResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *IncrResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.Decree = v
	}
	return nil
}

func (p *IncrResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *IncrResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("incr_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *IncrResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *IncrResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("new_value", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:new_value: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.NewValue_)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.new_value (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_value: ", p), err)
	}
	return err
}

func (p *IncrResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:app_id: ", p), err)
	}
	return err
}

func (p *IncrResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partition_index: ", p), err)
	}
	return err
}

func (p *IncrResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("decree", thrift.I64, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:decree: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Decree)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.decree (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:decree: ", p), err)
	}
	return err
}

func (p *IncrResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *IncrResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("IncrResponse(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - CheckSortKey
//  - CheckType
//  - CheckOperand
//  - SetDiffSortKey
//  - SetSortKey
//  - SetValue
//  - SetExpireTsSeconds
//  - ReturnCheckValue
type CheckAndSetRequest struct {
	HashKey            *base.Blob   `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	CheckSortKey       *base.Blob   `thrift:"check_sort_key,2" db:"check_sort_key" json:"check_sort_key"`
	CheckType          CasCheckType `thrift:"check_type,3" db:"check_type" json:"check_type"`
	CheckOperand       *base.Blob   `thrift:"check_operand,4" db:"check_operand" json:"check_operand"`
	SetDiffSortKey     bool         `thrift:"set_diff_sort_key,5" db:"set_diff_sort_key" json:"set_diff_sort_key"`
	SetSortKey         *base.Blob   `thrift:"set_sort_key,6" db:"set_sort_key" json:"set_sort_key"`
	SetValue           *base.Blob   `thrift:"set_value,7" db:"set_value" json:"set_value"`
	SetExpireTsSeconds int32        `thrift:"set_expire_ts_seconds,8" db:"set_expire_ts_seconds" json:"set_expire_ts_seconds"`
	ReturnCheckValue   bool         `thrift:"return_check_value,9" db:"return_check_value" json:"return_check_value"`
}

func NewCheckAndSetRequest() *CheckAndSetRequest {
	return &CheckAndSetRequest{}
}

var CheckAndSetRequest_HashKey_DEFAULT *base.Blob

func (p *CheckAndSetRequest) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return CheckAndSetRequest_HashKey_DEFAULT
	}
	return p.HashKey
}

var CheckAndSetRequest_CheckSortKey_DEFAULT *base.Blob

func (p *CheckAndSetRequest) GetCheckSortKey() *base.Blob {
	if !p.IsSetCheckSortKey() {
		return CheckAndSetRequest_CheckSortKey_DEFAULT
	}
	return p.CheckSortKey
}

func (p *CheckAndSetRequest) GetCheckType() CasCheckType {
	return p.CheckType
}

var CheckAndSetRequest_CheckOperand_DEFAULT *base.Blob

func (p *CheckAndSetRequest) GetCheckOperand() *base.Blob {
	if !p.IsSetCheckOperand() {
		return CheckAndSetRequest_CheckOperand_DEFAULT
	}
	return p.CheckOperand
}

func (p *CheckAndSetRequest) GetSetDiffSortKey() bool {
	return p.SetDiffSortKey
}

var CheckAndSetRequest_SetSortKey_DEFAULT *base.Blob

func (p *CheckAndSetRequest) GetSetSortKey() *base.Blob {
	if !p.IsSetSetSortKey() {
		return CheckAndSetRequest_SetSortKey_DEFAULT
	}
	return p.SetSortKey
}

var CheckAndSetRequest_SetValue_DEFAULT *base.Blob

func (p *CheckAndSetRequest) GetSetValue() *base.Blob {
	if !p.IsSetSetValue() {
		return CheckAndSetRequest_SetValue_DEFAULT
	}
	return p.SetValue
}

func (p *CheckAndSetRequest) GetSetExpireTsSeconds() int32 {
	return p.SetExpireTsSeconds
}

func (p *CheckAndSetRequest) GetReturnCheckValue() bool {
	return p.ReturnCheckValue
}
func (p *CheckAndSetRequest) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *CheckAndSetRequest) IsSetCheckSortKey() bool {
	return p.CheckSortKey != nil
}

func (p *CheckAndSetRequest) IsSetCheckOperand() bool {
	return p.CheckOperand != nil
}

func (p *CheckAndSetRequest) IsSetSetSortKey() bool {
	return p.SetSortKey != nil
}

func (p *CheckAndSetRequest) IsSetSetValue() bool {
	return p.SetValue != nil
}

func (p *CheckAndSetRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 8:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField8(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 9:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField9(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField2(iprot thrift.TProtocol) error {
	p.CheckSortKey = &base.Blob{}
	if err := p.CheckSortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckSortKey), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		temp := CasCheckType(v)
		p.CheckType = temp
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField4(iprot thrift.TProtocol) error {
	p.CheckOperand = &base.Blob{}
	if err := p.CheckOperand.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckOperand), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.SetDiffSortKey = v
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField6(iprot thrift.TProtocol) error {
	p.SetSortKey = &base.Blob{}
	if err := p.SetSortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SetSortKey), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField7(iprot thrift.TProtocol) error {
	p.SetValue = &base.Blob{}
	if err := p.SetValue.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SetValue), err)
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.SetExpireTsSeconds = v
	}
	return nil
}

func (p *CheckAndSetRequest) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		p.ReturnCheckValue = v
	}
	return nil
}

func (p *CheckAndSetRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_set_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
		if err := p.writeField8(oprot); err != nil {
			return err
		}
		if err := p.writeField9(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *CheckAndSetRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_sort_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_sort_key: ", p), err)
	}
	if err := p.CheckSortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckSortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_sort_key: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_type", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.CheckType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_type (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_type: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_operand", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_operand: ", p), err)
	}
	if err := p.CheckOperand.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckOperand), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_operand: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("set_diff_sort_key", thrift.BOOL, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:set_diff_sort_key: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.SetDiffSortKey)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.set_diff_sort_key (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:set_diff_sort_key: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("set_sort_key", thrift.STRUCT, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:set_sort_key: ", p), err)
	}
	if err := p.SetSortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SetSortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:set_sort_key: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("set_value", thrift.STRUCT, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:set_value: ", p), err)
	}
	if err := p.SetValue.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SetValue), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:set_value: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("set_expire_ts_seconds", thrift.I32, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:set_expire_ts_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.SetExpireTsSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.set_expire_ts_seconds (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:set_expire_ts_seconds: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("return_check_value", thrift.BOOL, 9); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:return_check_value: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.ReturnCheckValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.return_check_value (9) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 9:return_check_value: ", p), err)
	}
	return err
}

func (p *CheckAndSetRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CheckAndSetRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - CheckValueReturned
//  - CheckValueExist
//  - CheckValue
//  - AppID
//  - PartitionIndex
//  - Decree
//  - Server
type CheckAndSetResponse struct {
	Error              int32      `thrift:"error,1" db:"error" json:"error"`
	CheckValueReturned bool       `thrift:"check_value_returned,2" db:"check_value_returned" json:"check_value_returned"`
	CheckValueExist    bool       `thrift:"check_value_exist,3" db:"check_value_exist" json:"check_value_exist"`
	CheckValue         *base.Blob `thrift:"check_value,4" db:"check_value" json:"check_value"`
	AppID              int32      `thrift:"app_id,5" db:"app_id" json:"app_id"`
	PartitionIndex     int32      `thrift:"partition_index,6" db:"partition_index" json:"partition_index"`
	Decree             int64      `thrift:"decree,7" db:"decree" json:"decree"`
	Server             string     `thrift:"server,8" db:"server" json:"server"`
}

func NewCheckAndSetResponse() *CheckAndSetResponse {
	return &CheckAndSetResponse{}
}

func (p *CheckAndSetResponse) GetError() int32 {
	return p.Error
}

func (p *CheckAndSetResponse) GetCheckValueReturned() bool {
	return p.CheckValueReturned
}

func (p *CheckAndSetResponse) GetCheckValueExist() bool {
	return p.CheckValueExist
}

var CheckAndSetResponse_CheckValue_DEFAULT *base.Blob

func (p *CheckAndSetResponse) GetCheckValue() *base.Blob {
	if !p.IsSetCheckValue() {
		return CheckAndSetResponse_CheckValue_DEFAULT
	}
	return p.CheckValue
}

func (p *CheckAndSetResponse) GetAppID() int32 {
	return p.AppID
}

func (p *CheckAndSetResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *CheckAndSetResponse) GetDecree() int64 {
	return p.Decree
}

func (p *CheckAndSetResponse) GetServer() string {
	return p.Server
}
func (p *CheckAndSetResponse) IsSetCheckValue() bool {
	return p.CheckValue != nil
}

func (p *CheckAndSetResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField8(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.CheckValueReturned = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.CheckValueExist = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField4(iprot thrift.TProtocol) error {
	p.CheckValue = &base.Blob{}
	if err := p.CheckValue.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckValue), err)
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.Decree = v
	}
	return nil
}

func (p *CheckAndSetResponse) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *CheckAndSetResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_set_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
		if err := p.writeField8(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *CheckAndSetResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value_returned", thrift.BOOL, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_value_returned: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.CheckValueReturned)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_value_returned (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_value_returned: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value_exist", thrift.BOOL, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_value_exist: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.CheckValueExist)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_value_exist (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_value_exist: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_value: ", p), err)
	}
	if err := p.CheckValue.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckValue), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_value: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:app_id: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:partition_index: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("decree", thrift.I64, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:decree: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Decree)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.decree (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:decree: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:server: ", p), err)
	}
	return err
}

func (p *CheckAndSetResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CheckAndSetResponse(%+v)", *p)
}

// Attributes:
//  - Operation
//  - SortKey
//  - Value
//  - SetExpireTsSeconds
type Mutate struct {
	Operation          MutateOperation `thrift:"operation,1" db:"operation" json:"operation"`
	SortKey            *base.Blob      `thrift:"sort_key,2" db:"sort_key" json:"sort_key"`
	Value              *base.Blob      `thrift:"value,3" db:"value" json:"value"`
	SetExpireTsSeconds int32           `thrift:"set_expire_ts_seconds,4" db:"set_expire_ts_seconds" json:"set_expire_ts_seconds"`
}

func NewMutate() *Mutate {
	return &Mutate{}
}

func (p *Mutate) GetOperation() MutateOperation {
	return p.Operation
}

var Mutate_SortKey_DEFAULT *base.Blob

func (p *Mutate) GetSortKey() *base.Blob {
	if !p.IsSetSortKey() {
		return Mutate_SortKey_DEFAULT
	}
	return p.SortKey
}

var Mutate_Value_DEFAULT *base.Blob

func (p *Mutate) GetValue() *base.Blob {
	if !p.IsSetValue() {
		return Mutate_Value_DEFAULT
	}
	return p.Value
}

func (p *Mutate) GetSetExpireTsSeconds() int32 {
	return p.SetExpireTsSeconds
}
func (p *Mutate) IsSetSortKey() bool {
	return p.SortKey != nil
}

func (p *Mutate) IsSetValue() bool {
	return p.Value != nil
}

func (p *Mutate) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Mutate) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		temp := MutateOperation(v)
		p.Operation = temp
	}
	return nil
}

func (p *Mutate) ReadField2(iprot thrift.TProtocol) error {
	p.SortKey = &base.Blob{}
	if err := p.SortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKey), err)
	}
	return nil
}

func (p *Mutate) ReadField3(iprot thrift.TProtocol) error {
	p.Value = &base.Blob{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *Mutate) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.SetExpireTsSeconds = v
	}
	return nil
}

func (p *Mutate) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("mutate"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Mutate) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("operation", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operation: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Operation)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.operation (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operation: ", p), err)
	}
	return err
}

func (p *Mutate) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sort_key: ", p), err)
	}
	if err := p.SortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sort_key: ", p), err)
	}
	return err
}

func (p *Mutate) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:value: ", p), err)
	}
	if err := p.Value.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:value: ", p), err)
	}
	return err
}

func (p *Mutate) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("set_expire_ts_seconds", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:set_expire_ts_seconds: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.SetExpireTsSeconds)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.set_expire_ts_seconds (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:set_expire_ts_seconds: ", p), err)
	}
	return err
}

func (p *Mutate) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Mutate(%+v)", *p)
}

// Attributes:
//  - HashKey
//  - CheckSortKey
//  - CheckType
//  - CheckOperand
//  - MutateList
//  - ReturnCheckValue
type CheckAndMutateRequest struct {
	HashKey          *base.Blob   `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	CheckSortKey     *base.Blob   `thrift:"check_sort_key,2" db:"check_sort_key" json:"check_sort_key"`
	CheckType        CasCheckType `thrift:"check_type,3" db:"check_type" json:"check_type"`
	CheckOperand     *base.Blob   `thrift:"check_operand,4" db:"check_operand" json:"check_operand"`
	MutateList       []*Mutate    `thrift:"mutate_list,5" db:"mutate_list" json:"mutate_list"`
	ReturnCheckValue bool         `thrift:"return_check_value,6" db:"return_check_value" json:"return_check_value"`
}

func NewCheckAndMutateRequest() *CheckAndMutateRequest {
	return &CheckAndMutateRequest{}
}

var CheckAndMutateRequest_HashKey_DEFAULT *base.Blob

func (p *CheckAndMutateRequest) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return CheckAndMutateRequest_HashKey_DEFAULT
	}
	return p.HashKey
}

var CheckAndMutateRequest_CheckSortKey_DEFAULT *base.Blob

func (p *CheckAndMutateRequest) GetCheckSortKey() *base.Blob {
	if !p.IsSetCheckSortKey() {
		return CheckAndMutateRequest_CheckSortKey_DEFAULT
	}
	return p.CheckSortKey
}

func (p *CheckAndMutateRequest) GetCheckType() CasCheckType {
	return p.CheckType
}

var CheckAndMutateRequest_CheckOperand_DEFAULT *base.Blob

func (p *CheckAndMutateRequest) GetCheckOperand() *base.Blob {
	if !p.IsSetCheckOperand() {
		return CheckAndMutateRequest_CheckOperand_DEFAULT
	}
	return p.CheckOperand
}

func (p *CheckAndMutateRequest) GetMutateList() []*Mutate {
	return p.MutateList
}

func (p *CheckAndMutateRequest) GetReturnCheckValue() bool {
	return p.ReturnCheckValue
}
func (p *CheckAndMutateRequest) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *CheckAndMutateRequest) IsSetCheckSortKey() bool {
	return p.CheckSortKey != nil
}

func (p *CheckAndMutateRequest) IsSetCheckOperand() bool {
	return p.CheckOperand != nil
}

func (p *CheckAndMutateRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField2(iprot thrift.TProtocol) error {
	p.CheckSortKey = &base.Blob{}
	if err := p.CheckSortKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckSortKey), err)
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		temp := CasCheckType(v)
		p.CheckType = temp
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField4(iprot thrift.TProtocol) error {
	p.CheckOperand = &base.Blob{}
	if err := p.CheckOperand.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckOperand), err)
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*Mutate, 0, size)
	p.MutateList = tSlice
	for i := 0; i < size; i++ {
		_elem6 := &Mutate{}
		if err := _elem6.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err)
		}
		p.MutateList = append(p.MutateList, _elem6)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *CheckAndMutateRequest) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.ReturnCheckValue = v
	}
	return nil
}

func (p *CheckAndMutateRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_mutate_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *CheckAndMutateRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_sort_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_sort_key: ", p), err)
	}
	if err := p.CheckSortKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckSortKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_sort_key: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_type", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.CheckType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_type (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_type: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_operand", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_operand: ", p), err)
	}
	if err := p.CheckOperand.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckOperand), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_operand: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("mutate_list", thrift.LIST, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:mutate_list: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.MutateList)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.MutateList {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:mutate_list: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("return_check_value", thrift.BOOL, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:return_check_value: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.ReturnCheckValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.return_check_value (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:return_check_value: ", p), err)
	}
	return err
}

func (p *CheckAndMutateRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CheckAndMutateRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - CheckValueReturned
//  - CheckValueExist
//  - CheckValue
//  - AppID
//  - PartitionIndex
//  - Decree
//  - Server
type CheckAndMutateResponse struct {
	Error              int32      `thrift:"error,1" db:"error" json:"error"`
	CheckValueReturned bool       `thrift:"check_value_returned,2" db:"check_value_returned" json:"check_value_returned"`
	CheckValueExist    bool       `thrift:"check_value_exist,3" db:"check_value_exist" json:"check_value_exist"`
	CheckValue         *base.Blob `thrift:"check_value,4" db:"check_value" json:"check_value"`
	AppID              int32      `thrift:"app_id,5" db:"app_id" json:"app_id"`
	PartitionIndex     int32      `thrift:"partition_index,6" db:"partition_index" json:"partition_index"`
	Decree             int64      `thrift:"decree,7" db:"decree" json:"decree"`
	Server             string     `thrift:"server,8" db:"server" json:"server"`
}

func NewCheckAndMutateResponse() *CheckAndMutateResponse {
	return &CheckAndMutateResponse{}
}

func (p *CheckAndMutateResponse) GetError() int32 {
	return p.Error
}

func (p *CheckAndMutateResponse) GetCheckValueReturned() bool {
	return p.CheckValueReturned
}

func (p *CheckAndMutateResponse) GetCheckValueExist() bool {
	return p.CheckValueExist
}

var CheckAndMutateResponse_CheckValue_DEFAULT *base.Blob

func (p *CheckAndMutateResponse) GetCheckValue() *base.Blob {
	if !p.IsSetCheckValue() {
		return CheckAndMutateResponse_CheckValue_DEFAULT
	}
	return p.CheckValue
}

func (p *CheckAndMutateResponse) GetAppID() int32 {
	return p.AppID
}

func (p *CheckAndMutateResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *CheckAndMutateResponse) GetDecree() int64 {
	return p.Decree
}

func (p *CheckAndMutateResponse) GetServer() string {
	return p.Server
}
func (p *CheckAndMutateResponse) IsSetCheckValue() bool {
	return p.CheckValue != nil
}

func (p *CheckAndMutateResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField8(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.CheckValueReturned = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.CheckValueExist = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField4(iprot thrift.TProtocol) error {
	p.CheckValue = &base.Blob{}
	if err := p.CheckValue.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CheckValue), err)
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.Decree = v
	}
	return nil
}

func (p *CheckAndMutateResponse) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *CheckAndMutateResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_mutate_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
		if err := p.writeField8(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *CheckAndMutateResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value_returned", thrift.BOOL, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:check_value_returned: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.CheckValueReturned)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_value_returned (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:check_value_returned: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value_exist", thrift.BOOL, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:check_value_exist: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.CheckValueExist)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.check_value_exist (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:check_value_exist: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("check_value", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:check_value: ", p), err)
	}
	if err := p.CheckValue.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CheckValue), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:check_value: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:app_id: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:partition_index: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("decree", thrift.I64, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:decree: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Decree)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.decree (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:decree: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:server: ", p), err)
	}
	return err
}

func (p *CheckAndMutateResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CheckAndMutateResponse(%+v)", *p)
}

// Attributes:
//  - StartKey
//  - StopKey
//  - StartInclusive
//  - StopInclusive
//  - BatchSize
//  - NoValue
//  - HashKeyFilterType
//  - HashKeyFilterPattern
//  - SortKeyFilterType
//  - SortKeyFilterPattern
//  - ValidatePartitionHash
//  - ReturnExpireTs
//  - FullScan
//  - OnlyReturnCount
type GetScannerRequest struct {
	StartKey              *base.Blob `thrift:"start_key,1" db:"start_key" json:"start_key"`
	StopKey               *base.Blob `thrift:"stop_key,2" db:"stop_key" json:"stop_key"`
	StartInclusive        bool       `thrift:"start_inclusive,3" db:"start_inclusive" json:"start_inclusive"`
	StopInclusive         bool       `thrift:"stop_inclusive,4" db:"stop_inclusive" json:"stop_inclusive"`
	BatchSize             int32      `thrift:"batch_size,5" db:"batch_size" json:"batch_size"`
	NoValue               bool       `thrift:"no_value,6" db:"no_value" json:"no_value"`
	HashKeyFilterType     FilterType `thrift:"hash_key_filter_type,7" db:"hash_key_filter_type" json:"hash_key_filter_type"`
	HashKeyFilterPattern  *base.Blob `thrift:"hash_key_filter_pattern,8" db:"hash_key_filter_pattern" json:"hash_key_filter_pattern"`
	SortKeyFilterType     FilterType `thrift:"sort_key_filter_type,9" db:"sort_key_filter_type" json:"sort_key_filter_type"`
	SortKeyFilterPattern  *base.Blob `thrift:"sort_key_filter_pattern,10" db:"sort_key_filter_pattern" json:"sort_key_filter_pattern"`
	ValidatePartitionHash *bool      `thrift:"validate_partition_hash,11" db:"validate_partition_hash" json:"validate_partition_hash,omitempty"`
	ReturnExpireTs        *bool      `thrift:"return_expire_ts,12" db:"return_expire_ts" json:"return_expire_ts,omitempty"`
	FullScan              *bool      `thrift:"full_scan,13" db:"full_scan" json:"full_scan,omitempty"`
	OnlyReturnCount       bool       `thrift:"only_return_count,14" db:"only_return_count" json:"only_return_count"`
}

func NewGetScannerRequest() *GetScannerRequest {
	return &GetScannerRequest{}
}

var GetScannerRequest_StartKey_DEFAULT *base.Blob

func (p *GetScannerRequest) GetStartKey() *base.Blob {
	if !p.IsSetStartKey() {
		return GetScannerRequest_StartKey_DEFAULT
	}
	return p.StartKey
}

var GetScannerRequest_StopKey_DEFAULT *base.Blob

func (p *GetScannerRequest) GetStopKey() *base.Blob {
	if !p.IsSetStopKey() {
		return GetScannerRequest_StopKey_DEFAULT
	}
	return p.StopKey
}

func (p *GetScannerRequest) GetStartInclusive() bool {
	return p.StartInclusive
}

func (p *GetScannerRequest) GetStopInclusive() bool {
	return p.StopInclusive
}

func (p *GetScannerRequest) GetBatchSize() int32 {
	return p.BatchSize
}

func (p *GetScannerRequest) GetNoValue() bool {
	return p.NoValue
}

func (p *GetScannerRequest) GetHashKeyFilterType() FilterType {
	return p.HashKeyFilterType
}

var GetScannerRequest_HashKeyFilterPattern_DEFAULT *base.Blob

func (p *GetScannerRequest) GetHashKeyFilterPattern() *base.Blob {
	if !p.IsSetHashKeyFilterPattern() {
		return GetScannerRequest_HashKeyFilterPattern_DEFAULT
	}
	return p.HashKeyFilterPattern
}

func (p *GetScannerRequest) GetSortKeyFilterType() FilterType {
	return p.SortKeyFilterType
}

var GetScannerRequest_SortKeyFilterPattern_DEFAULT *base.Blob

func (p *GetScannerRequest) GetSortKeyFilterPattern() *base.Blob {
	if !p.IsSetSortKeyFilterPattern() {
		return GetScannerRequest_SortKeyFilterPattern_DEFAULT
	}
	return p.SortKeyFilterPattern
}

var GetScannerRequest_ValidatePartitionHash_DEFAULT bool

func (p *GetScannerRequest) GetValidatePartitionHash() bool {
	if !p.IsSetValidatePartitionHash() {
		return GetScannerRequest_ValidatePartitionHash_DEFAULT
	}
	return *p.ValidatePartitionHash
}

var GetScannerRequest_ReturnExpireTs_DEFAULT bool

func (p *GetScannerRequest) GetReturnExpireTs() bool {
	if !p.IsSetReturnExpireTs() {
		return GetScannerRequest_ReturnExpireTs_DEFAULT
	}
	return *p.ReturnExpireTs
}

var GetScannerRequest_FullScan_DEFAULT bool

func (p *GetScannerRequest) GetFullScan() bool {
	if !p.IsSetFullScan() {
		return GetScannerRequest_FullScan_DEFAULT
	}
	return *p.FullScan
}

var GetScannerRequest_OnlyReturnCount_DEFAULT bool = false

func (p *GetScannerRequest) GetOnlyReturnCount() bool {
	return p.OnlyReturnCount
}
func (p *GetScannerRequest) IsSetStartKey() bool {
	return p.StartKey != nil
}

func (p *GetScannerRequest) IsSetStopKey() bool {
	return p.StopKey != nil
}

func (p *GetScannerRequest) IsSetHashKeyFilterPattern() bool {
	return p.HashKeyFilterPattern != nil
}

func (p *GetScannerRequest) IsSetSortKeyFilterPattern() bool {
	return p.SortKeyFilterPattern != nil
}

func (p *GetScannerRequest) IsSetValidatePartitionHash() bool {
	return p.ValidatePartitionHash != nil
}

func (p *GetScannerRequest) IsSetReturnExpireTs() bool {
	return p.ReturnExpireTs != nil
}

func (p *GetScannerRequest) IsSetFullScan() bool {
	return p.FullScan != nil
}

func (p *GetScannerRequest) IsSetOnlyReturnCount() bool {
	return p.OnlyReturnCount != GetScannerRequest_OnlyReturnCount_DEFAULT
}

func (p *GetScannerRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 8:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField8(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 9:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField9(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 10:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField10(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 11:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField11(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 12:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField12(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 13:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField13(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 14:
			if fieldTypeId == thrift.BOOL {
				if err := p.ReadField14(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetScannerRequest) ReadField1(iprot thrift.TProtocol) error {
	p.StartKey = &base.Blob{}
	if err := p.StartKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartKey), err)
	}
	return nil
}

func (p *GetScannerRequest) ReadField2(iprot thrift.TProtocol) error {
	p.StopKey = &base.Blob{}
	if err := p.StopKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StopKey), err)
	}
	return nil
}

func (p *GetScannerRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.StartInclusive = v
	}
	return nil
}

func (p *GetScannerRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.StopInclusive = v
	}
	return nil
}

func (p *GetScannerRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.BatchSize = v
	}
	return nil
}

func (p *GetScannerRequest) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.NoValue = v
	}
	return nil
}

func (p *GetScannerRequest) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		temp := FilterType(v)
		p.HashKeyFilterType = temp
	}
	return nil
}

func (p *GetScannerRequest) ReadField8(iprot thrift.TProtocol) error {
	p.HashKeyFilterPattern = &base.Blob{}
	if err := p.HashKeyFilterPattern.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKeyFilterPattern), err)
	}
	return nil
}

func (p *GetScannerRequest) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		temp := FilterType(v)
		p.SortKeyFilterType = temp
	}
	return nil
}

func (p *GetScannerRequest) ReadField10(iprot thrift.TProtocol) error {
	p.SortKeyFilterPattern = &base.Blob{}
	if err := p.SortKeyFilterPattern.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SortKeyFilterPattern), err)
	}
	return nil
}

func (p *GetScannerRequest) ReadField11(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 11: ", err)
	} else {
		p.ValidatePartitionHash = &v
	}
	return nil
}

func (p *GetScannerRequest) ReadField12(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 12: ", err)
	} else {
		p.ReturnExpireTs = &v
	}
	return nil
}

func (p *GetScannerRequest) ReadField13(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 13: ", err)
	} else {
		p.FullScan = &v
	}
	return nil
}

func (p *GetScannerRequest) ReadField14(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 14: ", err)
	} else {
		p.OnlyReturnCount = v
	}
	return nil
}

func (p *GetScannerRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("get_scanner_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
		if err := p.writeField8(oprot); err != nil {
			return err
		}
		if err := p.writeField9(oprot); err != nil {
			return err
		}
		if err := p.writeField10(oprot); err != nil {
			return err
		}
		if err := p.writeField11(oprot); err != nil {
			return err
		}
		if err := p.writeField12(oprot); err != nil {
			return err
		}
		if err := p.writeField13(oprot); err != nil {
			return err
		}
		if err := p.writeField14(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetScannerRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:start_key: ", p), err)
	}
	if err := p.StartKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_key: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("stop_key", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stop_key: ", p), err)
	}
	if err := p.StopKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StopKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stop_key: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_inclusive", thrift.BOOL, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:start_inclusive: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.StartInclusive)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.start_inclusive (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:start_inclusive: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("stop_inclusive", thrift.BOOL, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stop_inclusive: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.StopInclusive)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.stop_inclusive (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stop_inclusive: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("batch_size", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:batch_size: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.BatchSize)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.batch_size (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:batch_size: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("no_value", thrift.BOOL, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:no_value: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.NoValue)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.no_value (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:no_value: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key_filter_type", thrift.I32, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:hash_key_filter_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.HashKeyFilterType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.hash_key_filter_type (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:hash_key_filter_type: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key_filter_pattern", thrift.STRUCT, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:hash_key_filter_pattern: ", p), err)
	}
	if err := p.HashKeyFilterPattern.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKeyFilterPattern), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:hash_key_filter_pattern: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key_filter_type", thrift.I32, 9); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:sort_key_filter_type: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.SortKeyFilterType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.sort_key_filter_type (9) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 9:sort_key_filter_type: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("sort_key_filter_pattern", thrift.STRUCT, 10); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:sort_key_filter_pattern: ", p), err)
	}
	if err := p.SortKeyFilterPattern.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SortKeyFilterPattern), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 10:sort_key_filter_pattern: ", p), err)
	}
	return err
}

func (p *GetScannerRequest) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetValidatePartitionHash() {
		if err := oprot.WriteFieldBegin("validate_partition_hash", thrift.BOOL, 11); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:validate_partition_hash: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.ValidatePartitionHash)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.validate_partition_hash (11) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 11:validate_partition_hash: ", p), err)
		}
	}
	return err
}

func (p *GetScannerRequest) writeField12(oprot thrift.TProtocol) (err error) {
	if p.IsSetReturnExpireTs() {
		if err := oprot.WriteFieldBegin("return_expire_ts", thrift.BOOL, 12); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:return_expire_ts: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.ReturnExpireTs)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.return_expire_ts (12) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 12:return_expire_ts: ", p), err)
		}
	}
	return err
}

func (p *GetScannerRequest) writeField13(oprot thrift.TProtocol) (err error) {
	if p.IsSetFullScan() {
		if err := oprot.WriteFieldBegin("full_scan", thrift.BOOL, 13); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:full_scan: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.FullScan)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.full_scan (13) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 13:full_scan: ", p), err)
		}
	}
	return err
}

func (p *GetScannerRequest) writeField14(oprot thrift.TProtocol) (err error) {
	if p.IsSetOnlyReturnCount() {
		if err := oprot.WriteFieldBegin("only_return_count", thrift.BOOL, 14); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:only_return_count: ", p), err)
		}
		if err := oprot.WriteBool(bool(p.OnlyReturnCount)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.only_return_count (14) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 14:only_return_count: ", p), err)
		}
	}
	return err
}

func (p *GetScannerRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetScannerRequest(%+v)", *p)
}

// Attributes:
//  - ContextID
type ScanRequest struct {
	ContextID int64 `thrift:"context_id,1" db:"context_id" json:"context_id"`
}

func NewScanRequest() *ScanRequest {
	return &ScanRequest{}
}

func (p *ScanRequest) GetContextID() int64 {
	return p.ContextID
}
func (p *ScanRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ScanRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ContextID = v
	}
	return nil
}

func (p *ScanRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("scan_request"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ScanRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("context_id", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:context_id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.ContextID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.context_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:context_id: ", p), err)
	}
	return err
}

func (p *ScanRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ScanRequest(%+v)", *p)
}

// Attributes:
//  - Error
//  - Kvs
//  - ContextID
//  - AppID
//  - PartitionIndex
//  - Server
//  - KvCount
type ScanResponse struct {
	Error          int32       `thrift:"error,1" db:"error" json:"error"`
	Kvs            []*KeyValue `thrift:"kvs,2" db:"kvs" json:"kvs"`
	ContextID      int64       `thrift:"context_id,3" db:"context_id" json:"context_id"`
	AppID          int32       `thrift:"app_id,4" db:"app_id" json:"app_id"`
	PartitionIndex int32       `thrift:"partition_index,5" db:"partition_index" json:"partition_index"`
	Server         string      `thrift:"server,6" db:"server" json:"server"`
	KvCount        *int32      `thrift:"kv_count,7" db:"kv_count" json:"kv_count,omitempty"`
}

func NewScanResponse() *ScanResponse {
	return &ScanResponse{}
}

func (p *ScanResponse) GetError() int32 {
	return p.Error
}

func (p *ScanResponse) GetKvs() []*KeyValue {
	return p.Kvs
}

func (p *ScanResponse) GetContextID() int64 {
	return p.ContextID
}

func (p *ScanResponse) GetAppID() int32 {
	return p.AppID
}

func (p *ScanResponse) GetPartitionIndex() int32 {
	return p.PartitionIndex
}

func (p *ScanResponse) GetServer() string {
	return p.Server
}

var ScanResponse_KvCount_DEFAULT int32

func (p *ScanResponse) GetKvCount() int32 {
	if !p.IsSetKvCount() {
		return ScanResponse_KvCount_DEFAULT
	}
	return *p.KvCount
}
func (p *ScanResponse) IsSetKvCount() bool {
	return p.KvCount != nil
}

func (p *ScanResponse) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField2(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField3(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 4:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField4(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 5:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField5(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.I32 {
				if err := p.ReadField7(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ScanResponse) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Error = v
	}
	return nil
}

func (p *ScanResponse) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*KeyValue, 0, size)
	p.Kvs = tSlice
	for i := 0; i < size; i++ {
		_elem7 := &KeyValue{}
		if err := _elem7.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err)
		}
		p.Kvs = append(p.Kvs, _elem7)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *ScanResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.ContextID = v
	}
	return nil
}

func (p *ScanResponse) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.AppID = v
	}
	return nil
}

func (p *ScanResponse) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.PartitionIndex = v
	}
	return nil
}

func (p *ScanResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Server = v
	}
	return nil
}

func (p *ScanResponse) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.KvCount = &v
	}
	return nil
}

func (p *ScanResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("scan_response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
		if err := p.writeField2(oprot); err != nil {
			return err
		}
		if err := p.writeField3(oprot); err != nil {
			return err
		}
		if err := p.writeField4(oprot); err != nil {
			return err
		}
		if err := p.writeField5(oprot); err != nil {
			return err
		}
		if err := p.writeField6(oprot); err != nil {
			return err
		}
		if err := p.writeField7(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ScanResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("error", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Error)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.error (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("kvs", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:kvs: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Kvs)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Kvs {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:kvs: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("context_id", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:context_id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.ContextID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.context_id (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:context_id: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:app_id: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("partition_index", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:partition_index: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PartitionIndex)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.partition_index (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:partition_index: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("server", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:server: ", p), err)
	}
	if err := oprot.WriteString(string(p.Server)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.server (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:server: ", p), err)
	}
	return err
}

func (p *ScanResponse) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetKvCount() {
		if err := oprot.WriteFieldBegin("kv_count", thrift.I32, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:kv_count: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.KvCount)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.kv_count (7) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:kv_count: ", p), err)
		}
	}
	return err
}

func (p *ScanResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ScanResponse(%+v)", *p)
}

type Rrdb interface {
	// Parameters:
	//  - Update
	Put(ctx context.Context, update *UpdateRequest) (r *UpdateResponse, err error)
	// Parameters:
	//  - Request
	MultiPut(ctx context.Context, request *MultiPutRequest) (r *UpdateResponse, err error)
	// Parameters:
	//  - Key
	Remove(ctx context.Context, key *base.Blob) (r *UpdateResponse, err error)
	// Parameters:
	//  - Request
	MultiRemove(ctx context.Context, request *MultiRemoveRequest) (r *MultiRemoveResponse, err error)
	// Parameters:
	//  - Request
	Incr(ctx context.Context, request *IncrRequest) (r *IncrResponse, err error)
	// Parameters:
	//  - Request
	CheckAndSet(ctx context.Context, request *CheckAndSetRequest) (r *CheckAndSetResponse, err error)
	// Parameters:
	//  - Request
	CheckAndMutate(ctx context.Context, request *CheckAndMutateRequest) (r *CheckAndMutateResponse, err error)
	// Parameters:
	//  - Key
	Get(ctx context.Context, key *base.Blob) (r *ReadResponse, err error)
	// Parameters:
	//  - Request
	MultiGet(ctx context.Context, request *MultiGetRequest) (r *MultiGetResponse, err error)
	// Parameters:
	//  - Request
	BatchGet(ctx context.Context, request *BatchGetRequest) (r *BatchGetResponse, err error)
	// Parameters:
	//  - HashKey
	SortkeyCount(ctx context.Context, hash_key *base.Blob) (r *CountResponse, err error)
	// Parameters:
	//  - Key
	TTL(ctx context.Context, key *base.Blob) (r *TTLResponse, err error)
	// Parameters:
	//  - Request
	GetScanner(ctx context.Context, request *GetScannerRequest) (r *ScanResponse, err error)
	// Parameters:
	//  - Request
	Scan(ctx context.Context, request *ScanRequest) (r *ScanResponse, err error)
	// Parameters:
	//  - ContextID
	ClearScanner(ctx context.Context, context_id int64) (err error)
}

type RrdbClient struct {
	c thrift.TClient
}

func NewRrdbClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RrdbClient {
	return &RrdbClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

func NewRrdbClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RrdbClient {
	return &RrdbClient{
		c: thrift.NewTStandardClient(iprot, oprot),
	}
}

func NewRrdbClient(c thrift.TClient) *RrdbClient {
	return &RrdbClient{
		c: c,
	}
}

func (p *RrdbClient) Client_() thrift.TClient {
	return p.c
}

// Parameters:
//  - Update
func (p *RrdbClient) Put(ctx context.Context, update *UpdateRequest) (r *UpdateResponse, err error) {
	var _args8 RrdbPutArgs
	_args8.Update = update
	var _result9 RrdbPutResult
	if err = p.Client_().Call(ctx, "put", &_args8, &_result9); err != nil {
		return
	}
	return _result9.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) MultiPut(ctx context.Context, request *MultiPutRequest) (r *UpdateResponse, err error) {
	var _args10 RrdbMultiPutArgs
	_args10.Request = request
	var _result11 RrdbMultiPutResult
	if err = p.Client_().Call(ctx, "multi_put", &_args10, &_result11); err != nil {
		return
	}
	return _result11.GetSuccess(), nil
}

// Parameters:
//  - Key
func (p *RrdbClient) Remove(ctx context.Context, key *base.Blob) (r *UpdateResponse, err error) {
	var _args12 RrdbRemoveArgs
	_args12.Key = key
	var _result13 RrdbRemoveResult
	if err = p.Client_().Call(ctx, "remove", &_args12, &_result13); err != nil {
		return
	}
	return _result13.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) MultiRemove(ctx context.Context, request *MultiRemoveRequest) (r *MultiRemoveResponse, err error) {
	var _args14 RrdbMultiRemoveArgs
	_args14.Request = request
	var _result15 RrdbMultiRemoveResult
	if err = p.Client_().Call(ctx, "multi_remove", &_args14, &_result15); err != nil {
		return
	}
	return _result15.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) Incr(ctx context.Context, request *IncrRequest) (r *IncrResponse, err error) {
	var _args16 RrdbIncrArgs
	_args16.Request = request
	var _result17 RrdbIncrResult
	if err = p.Client_().Call(ctx, "incr", &_args16, &_result17); err != nil {
		return
	}
	return _result17.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) CheckAndSet(ctx context.Context, request *CheckAndSetRequest) (r *CheckAndSetResponse, err error) {
	var _args18 RrdbCheckAndSetArgs
	_args18.Request = request
	var _result19 RrdbCheckAndSetResult
	if err = p.Client_().Call(ctx, "check_and_set", &_args18, &_result19); err != nil {
		return
	}
	return _result19.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) CheckAndMutate(ctx context.Context, request *CheckAndMutateRequest) (r *CheckAndMutateResponse, err error) {
	var _args20 RrdbCheckAndMutateArgs
	_args20.Request = request
	var _result21 RrdbCheckAndMutateResult
	if err = p.Client_().Call(ctx, "check_and_mutate", &_args20, &_result21); err != nil {
		return
	}
	return _result21.GetSuccess(), nil
}

// Parameters:
//  - Key
func (p *RrdbClient) Get(ctx context.Context, key *base.Blob) (r *ReadResponse, err error) {
	var _args22 RrdbGetArgs
	_args22.Key = key
	var _result23 RrdbGetResult
	if err = p.Client_().Call(ctx, "get", &_args22, &_result23); err != nil {
		return
	}
	return _result23.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) MultiGet(ctx context.Context, request *MultiGetRequest) (r *MultiGetResponse, err error) {
	var _args24 RrdbMultiGetArgs
	_args24.Request = request
	var _result25 RrdbMultiGetResult
	if err = p.Client_().Call(ctx, "multi_get", &_args24, &_result25); err != nil {
		return
	}
	return _result25.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) BatchGet(ctx context.Context, request *BatchGetRequest) (r *BatchGetResponse, err error) {
	var _args26 RrdbBatchGetArgs
	_args26.Request = request
	var _result27 RrdbBatchGetResult
	if err = p.Client_().Call(ctx, "batch_get", &_args26, &_result27); err != nil {
		return
	}
	return _result27.GetSuccess(), nil
}

// Parameters:
//  - HashKey
func (p *RrdbClient) SortkeyCount(ctx context.Context, hash_key *base.Blob) (r *CountResponse, err error) {
	var _args28 RrdbSortkeyCountArgs
	_args28.HashKey = hash_key
	var _result29 RrdbSortkeyCountResult
	if err = p.Client_().Call(ctx, "sortkey_count", &_args28, &_result29); err != nil {
		return
	}
	return _result29.GetSuccess(), nil
}

// Parameters:
//  - Key
func (p *RrdbClient) TTL(ctx context.Context, key *base.Blob) (r *TTLResponse, err error) {
	var _args30 RrdbTTLArgs
	_args30.Key = key
	var _result31 RrdbTTLResult
	if err = p.Client_().Call(ctx, "ttl", &_args30, &_result31); err != nil {
		return
	}
	return _result31.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) GetScanner(ctx context.Context, request *GetScannerRequest) (r *ScanResponse, err error) {
	var _args32 RrdbGetScannerArgs
	_args32.Request = request
	var _result33 RrdbGetScannerResult
	if err = p.Client_().Call(ctx, "get_scanner", &_args32, &_result33); err != nil {
		return
	}
	return _result33.GetSuccess(), nil
}

// Parameters:
//  - Request
func (p *RrdbClient) Scan(ctx context.Context, request *ScanRequest) (r *ScanResponse, err error) {
	var _args34 RrdbScanArgs
	_args34.Request = request
	var _result35 RrdbScanResult
	if err = p.Client_().Call(ctx, "scan", &_args34, &_result35); err != nil {
		return
	}
	return _result35.GetSuccess(), nil
}

// Parameters:
//  - ContextID
func (p *RrdbClient) ClearScanner(ctx context.Context, context_id int64) (err error) {
	var _args36 RrdbClearScannerArgs
	_args36.ContextID = context_id
	if err := p.Client_().Call(ctx, "clear_scanner", &_args36, nil); err != nil {
		return err
	}
	return nil
}

type RrdbProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      Rrdb
}

func (p *RrdbProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
	p.processorMap[key] = processor
}

func (p *RrdbProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
	processor, ok = p.processorMap[key]
	return processor, ok
}

func (p *RrdbProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
	return p.processorMap
}

func NewRrdbProcessor(handler Rrdb) *RrdbProcessor {

	self37 := &RrdbProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self37.processorMap["put"] = &rrdbProcessorPut{handler: handler}
	self37.processorMap["multi_put"] = &rrdbProcessorMultiPut{handler: handler}
	self37.processorMap["remove"] = &rrdbProcessorRemove{handler: handler}
	self37.processorMap["multi_remove"] = &rrdbProcessorMultiRemove{handler: handler}
	self37.processorMap["incr"] = &rrdbProcessorIncr{handler: handler}
	self37.processorMap["check_and_set"] = &rrdbProcessorCheckAndSet{handler: handler}
	self37.processorMap["check_and_mutate"] = &rrdbProcessorCheckAndMutate{handler: handler}
	self37.processorMap["get"] = &rrdbProcessorGet{handler: handler}
	self37.processorMap["multi_get"] = &rrdbProcessorMultiGet{handler: handler}
	self37.processorMap["batch_get"] = &rrdbProcessorBatchGet{handler: handler}
	self37.processorMap["sortkey_count"] = &rrdbProcessorSortkeyCount{handler: handler}
	self37.processorMap["ttl"] = &rrdbProcessorTTL{handler: handler}
	self37.processorMap["get_scanner"] = &rrdbProcessorGetScanner{handler: handler}
	self37.processorMap["scan"] = &rrdbProcessorScan{handler: handler}
	self37.processorMap["clear_scanner"] = &rrdbProcessorClearScanner{handler: handler}
	return self37
}

func (p *RrdbProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	name, _, seqId, err := iprot.ReadMessageBegin()
	if err != nil {
		return false, err
	}
	if processor, ok := p.GetProcessorFunction(name); ok {
		return processor.Process(ctx, seqId, iprot, oprot)
	}
	iprot.Skip(thrift.STRUCT)
	iprot.ReadMessageEnd()
	x38 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x38.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush(ctx)
	return false, x38

}

type rrdbProcessorPut struct {
	handler Rrdb
}

func (p *rrdbProcessorPut) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbPutArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("put", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbPutResult{}
	var retval *UpdateResponse
	var err2 error
	if retval, err2 = p.handler.Put(ctx, args.Update); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: "+err2.Error())
		oprot.WriteMessageBegin("put", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("put", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorMultiPut struct {
	handler Rrdb
}

func (p *rrdbProcessorMultiPut) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbMultiPutArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("multi_put", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbMultiPutResult{}
	var retval *UpdateResponse
	var err2 error
	if retval, err2 = p.handler.MultiPut(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_put: "+err2.Error())
		oprot.WriteMessageBegin("multi_put", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("multi_put", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorRemove struct {
	handler Rrdb
}

func (p *rrdbProcessorRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbRemoveArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("remove", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbRemoveResult{}
	var retval *UpdateResponse
	var err2 error
	if retval, err2 = p.handler.Remove(ctx, args.Key); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: "+err2.Error())
		oprot.WriteMessageBegin("remove", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("remove", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorMultiRemove struct {
	handler Rrdb
}

func (p *rrdbProcessorMultiRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbMultiRemoveArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("multi_remove", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbMultiRemoveResult{}
	var retval *MultiRemoveResponse
	var err2 error
	if retval, err2 = p.handler.MultiRemove(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_remove: "+err2.Error())
		oprot.WriteMessageBegin("multi_remove", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("multi_remove", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorIncr struct {
	handler Rrdb
}

func (p *rrdbProcessorIncr) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbIncrArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("incr", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbIncrResult{}
	var retval *IncrResponse
	var err2 error
	if retval, err2 = p.handler.Incr(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing incr: "+err2.Error())
		oprot.WriteMessageBegin("incr", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("incr", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorCheckAndSet struct {
	handler Rrdb
}

func (p *rrdbProcessorCheckAndSet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbCheckAndSetArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("check_and_set", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbCheckAndSetResult{}
	var retval *CheckAndSetResponse
	var err2 error
	if retval, err2 = p.handler.CheckAndSet(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing check_and_set: "+err2.Error())
		oprot.WriteMessageBegin("check_and_set", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("check_and_set", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorCheckAndMutate struct {
	handler Rrdb
}

func (p *rrdbProcessorCheckAndMutate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbCheckAndMutateArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("check_and_mutate", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbCheckAndMutateResult{}
	var retval *CheckAndMutateResponse
	var err2 error
	if retval, err2 = p.handler.CheckAndMutate(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing check_and_mutate: "+err2.Error())
		oprot.WriteMessageBegin("check_and_mutate", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("check_and_mutate", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorGet struct {
	handler Rrdb
}

func (p *rrdbProcessorGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbGetArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbGetResult{}
	var retval *ReadResponse
	var err2 error
	if retval, err2 = p.handler.Get(ctx, args.Key); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: "+err2.Error())
		oprot.WriteMessageBegin("get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("get", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorMultiGet struct {
	handler Rrdb
}

func (p *rrdbProcessorMultiGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbMultiGetArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("multi_get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbMultiGetResult{}
	var retval *MultiGetResponse
	var err2 error
	if retval, err2 = p.handler.MultiGet(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing multi_get: "+err2.Error())
		oprot.WriteMessageBegin("multi_get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("multi_get", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorBatchGet struct {
	handler Rrdb
}

func (p *rrdbProcessorBatchGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbBatchGetArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("batch_get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbBatchGetResult{}
	var retval *BatchGetResponse
	var err2 error
	if retval, err2 = p.handler.BatchGet(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing batch_get: "+err2.Error())
		oprot.WriteMessageBegin("batch_get", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("batch_get", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorSortkeyCount struct {
	handler Rrdb
}

func (p *rrdbProcessorSortkeyCount) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbSortkeyCountArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("sortkey_count", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbSortkeyCountResult{}
	var retval *CountResponse
	var err2 error
	if retval, err2 = p.handler.SortkeyCount(ctx, args.HashKey); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing sortkey_count: "+err2.Error())
		oprot.WriteMessageBegin("sortkey_count", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("sortkey_count", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorTTL struct {
	handler Rrdb
}

func (p *rrdbProcessorTTL) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbTTLArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("ttl", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbTTLResult{}
	var retval *TTLResponse
	var err2 error
	if retval, err2 = p.handler.TTL(ctx, args.Key); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ttl: "+err2.Error())
		oprot.WriteMessageBegin("ttl", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("ttl", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorGetScanner struct {
	handler Rrdb
}

func (p *rrdbProcessorGetScanner) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbGetScannerArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("get_scanner", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbGetScannerResult{}
	var retval *ScanResponse
	var err2 error
	if retval, err2 = p.handler.GetScanner(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_scanner: "+err2.Error())
		oprot.WriteMessageBegin("get_scanner", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("get_scanner", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorScan struct {
	handler Rrdb
}

func (p *rrdbProcessorScan) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbScanArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("scan", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := RrdbScanResult{}
	var retval *ScanResponse
	var err2 error
	if retval, err2 = p.handler.Scan(ctx, args.Request); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scan: "+err2.Error())
		oprot.WriteMessageBegin("scan", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("scan", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type rrdbProcessorClearScanner struct {
	handler Rrdb
}

func (p *rrdbProcessorClearScanner) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := RrdbClearScannerArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	if err2 = p.handler.ClearScanner(ctx, args.ContextID); err2 != nil {
		return true, err2
	}
	return true, nil
}

// HELPER FUNCTIONS AND STRUCTURES

// Attributes:
//  - Update
type RrdbPutArgs struct {
	Update *UpdateRequest `thrift:"update,1" db:"update" json:"update"`
}

func NewRrdbPutArgs() *RrdbPutArgs {
	return &RrdbPutArgs{}
}

var RrdbPutArgs_Update_DEFAULT *UpdateRequest

func (p *RrdbPutArgs) GetUpdate() *UpdateRequest {
	if !p.IsSetUpdate() {
		return RrdbPutArgs_Update_DEFAULT
	}
	return p.Update
}
func (p *RrdbPutArgs) IsSetUpdate() bool {
	return p.Update != nil
}

func (p *RrdbPutArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbPutArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Update = &UpdateRequest{}
	if err := p.Update.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Update), err)
	}
	return nil
}

func (p *RrdbPutArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("put_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbPutArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("update", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:update: ", p), err)
	}
	if err := p.Update.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Update), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:update: ", p), err)
	}
	return err
}

func (p *RrdbPutArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbPutArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbPutResult struct {
	Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbPutResult() *RrdbPutResult {
	return &RrdbPutResult{}
}

var RrdbPutResult_Success_DEFAULT *UpdateResponse

func (p *RrdbPutResult) GetSuccess() *UpdateResponse {
	if !p.IsSetSuccess() {
		return RrdbPutResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbPutResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbPutResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbPutResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &UpdateResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbPutResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("put_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbPutResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbPutResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbPutResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbMultiPutArgs struct {
	Request *MultiPutRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbMultiPutArgs() *RrdbMultiPutArgs {
	return &RrdbMultiPutArgs{}
}

var RrdbMultiPutArgs_Request_DEFAULT *MultiPutRequest

func (p *RrdbMultiPutArgs) GetRequest() *MultiPutRequest {
	if !p.IsSetRequest() {
		return RrdbMultiPutArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbMultiPutArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbMultiPutArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiPutArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &MultiPutRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbMultiPutArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_put_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiPutArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbMultiPutArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiPutArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbMultiPutResult struct {
	Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbMultiPutResult() *RrdbMultiPutResult {
	return &RrdbMultiPutResult{}
}

var RrdbMultiPutResult_Success_DEFAULT *UpdateResponse

func (p *RrdbMultiPutResult) GetSuccess() *UpdateResponse {
	if !p.IsSetSuccess() {
		return RrdbMultiPutResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbMultiPutResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbMultiPutResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiPutResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &UpdateResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbMultiPutResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_put_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiPutResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbMultiPutResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiPutResult(%+v)", *p)
}

// Attributes:
//  - Key
type RrdbRemoveArgs struct {
	Key *base.Blob `thrift:"key,1" db:"key" json:"key"`
}

func NewRrdbRemoveArgs() *RrdbRemoveArgs {
	return &RrdbRemoveArgs{}
}

var RrdbRemoveArgs_Key_DEFAULT *base.Blob

func (p *RrdbRemoveArgs) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return RrdbRemoveArgs_Key_DEFAULT
	}
	return p.Key
}
func (p *RrdbRemoveArgs) IsSetKey() bool {
	return p.Key != nil
}

func (p *RrdbRemoveArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbRemoveArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *RrdbRemoveArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("remove_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbRemoveArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *RrdbRemoveArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbRemoveArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbRemoveResult struct {
	Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbRemoveResult() *RrdbRemoveResult {
	return &RrdbRemoveResult{}
}

var RrdbRemoveResult_Success_DEFAULT *UpdateResponse

func (p *RrdbRemoveResult) GetSuccess() *UpdateResponse {
	if !p.IsSetSuccess() {
		return RrdbRemoveResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbRemoveResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbRemoveResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbRemoveResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &UpdateResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbRemoveResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("remove_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbRemoveResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbRemoveResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbRemoveResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbMultiRemoveArgs struct {
	Request *MultiRemoveRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbMultiRemoveArgs() *RrdbMultiRemoveArgs {
	return &RrdbMultiRemoveArgs{}
}

var RrdbMultiRemoveArgs_Request_DEFAULT *MultiRemoveRequest

func (p *RrdbMultiRemoveArgs) GetRequest() *MultiRemoveRequest {
	if !p.IsSetRequest() {
		return RrdbMultiRemoveArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbMultiRemoveArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbMultiRemoveArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiRemoveArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &MultiRemoveRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbMultiRemoveArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_remove_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiRemoveArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbMultiRemoveArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiRemoveArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbMultiRemoveResult struct {
	Success *MultiRemoveResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbMultiRemoveResult() *RrdbMultiRemoveResult {
	return &RrdbMultiRemoveResult{}
}

var RrdbMultiRemoveResult_Success_DEFAULT *MultiRemoveResponse

func (p *RrdbMultiRemoveResult) GetSuccess() *MultiRemoveResponse {
	if !p.IsSetSuccess() {
		return RrdbMultiRemoveResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbMultiRemoveResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbMultiRemoveResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiRemoveResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &MultiRemoveResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbMultiRemoveResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_remove_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiRemoveResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbMultiRemoveResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiRemoveResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbIncrArgs struct {
	Request *IncrRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbIncrArgs() *RrdbIncrArgs {
	return &RrdbIncrArgs{}
}

var RrdbIncrArgs_Request_DEFAULT *IncrRequest

func (p *RrdbIncrArgs) GetRequest() *IncrRequest {
	if !p.IsSetRequest() {
		return RrdbIncrArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbIncrArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbIncrArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbIncrArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &IncrRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbIncrArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("incr_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbIncrArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbIncrArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbIncrArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbIncrResult struct {
	Success *IncrResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbIncrResult() *RrdbIncrResult {
	return &RrdbIncrResult{}
}

var RrdbIncrResult_Success_DEFAULT *IncrResponse

func (p *RrdbIncrResult) GetSuccess() *IncrResponse {
	if !p.IsSetSuccess() {
		return RrdbIncrResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbIncrResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbIncrResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbIncrResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &IncrResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbIncrResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("incr_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbIncrResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbIncrResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbIncrResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbCheckAndSetArgs struct {
	Request *CheckAndSetRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbCheckAndSetArgs() *RrdbCheckAndSetArgs {
	return &RrdbCheckAndSetArgs{}
}

var RrdbCheckAndSetArgs_Request_DEFAULT *CheckAndSetRequest

func (p *RrdbCheckAndSetArgs) GetRequest() *CheckAndSetRequest {
	if !p.IsSetRequest() {
		return RrdbCheckAndSetArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbCheckAndSetArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbCheckAndSetArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbCheckAndSetArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &CheckAndSetRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbCheckAndSetArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_set_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbCheckAndSetArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbCheckAndSetArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbCheckAndSetArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbCheckAndSetResult struct {
	Success *CheckAndSetResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbCheckAndSetResult() *RrdbCheckAndSetResult {
	return &RrdbCheckAndSetResult{}
}

var RrdbCheckAndSetResult_Success_DEFAULT *CheckAndSetResponse

func (p *RrdbCheckAndSetResult) GetSuccess() *CheckAndSetResponse {
	if !p.IsSetSuccess() {
		return RrdbCheckAndSetResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbCheckAndSetResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbCheckAndSetResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbCheckAndSetResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &CheckAndSetResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbCheckAndSetResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_set_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbCheckAndSetResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbCheckAndSetResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbCheckAndSetResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbCheckAndMutateArgs struct {
	Request *CheckAndMutateRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbCheckAndMutateArgs() *RrdbCheckAndMutateArgs {
	return &RrdbCheckAndMutateArgs{}
}

var RrdbCheckAndMutateArgs_Request_DEFAULT *CheckAndMutateRequest

func (p *RrdbCheckAndMutateArgs) GetRequest() *CheckAndMutateRequest {
	if !p.IsSetRequest() {
		return RrdbCheckAndMutateArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbCheckAndMutateArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbCheckAndMutateArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbCheckAndMutateArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &CheckAndMutateRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbCheckAndMutateArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_mutate_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbCheckAndMutateArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbCheckAndMutateArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbCheckAndMutateArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbCheckAndMutateResult struct {
	Success *CheckAndMutateResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbCheckAndMutateResult() *RrdbCheckAndMutateResult {
	return &RrdbCheckAndMutateResult{}
}

var RrdbCheckAndMutateResult_Success_DEFAULT *CheckAndMutateResponse

func (p *RrdbCheckAndMutateResult) GetSuccess() *CheckAndMutateResponse {
	if !p.IsSetSuccess() {
		return RrdbCheckAndMutateResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbCheckAndMutateResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbCheckAndMutateResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbCheckAndMutateResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &CheckAndMutateResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbCheckAndMutateResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("check_and_mutate_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbCheckAndMutateResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbCheckAndMutateResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbCheckAndMutateResult(%+v)", *p)
}

// Attributes:
//  - Key
type RrdbGetArgs struct {
	Key *base.Blob `thrift:"key,1" db:"key" json:"key"`
}

func NewRrdbGetArgs() *RrdbGetArgs {
	return &RrdbGetArgs{}
}

var RrdbGetArgs_Key_DEFAULT *base.Blob

func (p *RrdbGetArgs) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return RrdbGetArgs_Key_DEFAULT
	}
	return p.Key
}
func (p *RrdbGetArgs) IsSetKey() bool {
	return p.Key != nil
}

func (p *RrdbGetArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbGetArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *RrdbGetArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("get_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbGetArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *RrdbGetArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbGetArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbGetResult struct {
	Success *ReadResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbGetResult() *RrdbGetResult {
	return &RrdbGetResult{}
}

var RrdbGetResult_Success_DEFAULT *ReadResponse

func (p *RrdbGetResult) GetSuccess() *ReadResponse {
	if !p.IsSetSuccess() {
		return RrdbGetResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbGetResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbGetResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbGetResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &ReadResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbGetResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("get_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbGetResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbGetResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbGetResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbMultiGetArgs struct {
	Request *MultiGetRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbMultiGetArgs() *RrdbMultiGetArgs {
	return &RrdbMultiGetArgs{}
}

var RrdbMultiGetArgs_Request_DEFAULT *MultiGetRequest

func (p *RrdbMultiGetArgs) GetRequest() *MultiGetRequest {
	if !p.IsSetRequest() {
		return RrdbMultiGetArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbMultiGetArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbMultiGetArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiGetArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &MultiGetRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbMultiGetArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_get_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiGetArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbMultiGetArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiGetArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbMultiGetResult struct {
	Success *MultiGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbMultiGetResult() *RrdbMultiGetResult {
	return &RrdbMultiGetResult{}
}

var RrdbMultiGetResult_Success_DEFAULT *MultiGetResponse

func (p *RrdbMultiGetResult) GetSuccess() *MultiGetResponse {
	if !p.IsSetSuccess() {
		return RrdbMultiGetResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbMultiGetResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbMultiGetResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbMultiGetResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &MultiGetResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbMultiGetResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("multi_get_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbMultiGetResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbMultiGetResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbMultiGetResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbBatchGetArgs struct {
	Request *BatchGetRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbBatchGetArgs() *RrdbBatchGetArgs {
	return &RrdbBatchGetArgs{}
}

var RrdbBatchGetArgs_Request_DEFAULT *BatchGetRequest

func (p *RrdbBatchGetArgs) GetRequest() *BatchGetRequest {
	if !p.IsSetRequest() {
		return RrdbBatchGetArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbBatchGetArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbBatchGetArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbBatchGetArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &BatchGetRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbBatchGetArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("batch_get_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbBatchGetArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbBatchGetArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbBatchGetArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbBatchGetResult struct {
	Success *BatchGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbBatchGetResult() *RrdbBatchGetResult {
	return &RrdbBatchGetResult{}
}

var RrdbBatchGetResult_Success_DEFAULT *BatchGetResponse

func (p *RrdbBatchGetResult) GetSuccess() *BatchGetResponse {
	if !p.IsSetSuccess() {
		return RrdbBatchGetResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbBatchGetResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbBatchGetResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbBatchGetResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &BatchGetResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbBatchGetResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("batch_get_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbBatchGetResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbBatchGetResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbBatchGetResult(%+v)", *p)
}

// Attributes:
//  - HashKey
type RrdbSortkeyCountArgs struct {
	HashKey *base.Blob `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
}

func NewRrdbSortkeyCountArgs() *RrdbSortkeyCountArgs {
	return &RrdbSortkeyCountArgs{}
}

var RrdbSortkeyCountArgs_HashKey_DEFAULT *base.Blob

func (p *RrdbSortkeyCountArgs) GetHashKey() *base.Blob {
	if !p.IsSetHashKey() {
		return RrdbSortkeyCountArgs_HashKey_DEFAULT
	}
	return p.HashKey
}
func (p *RrdbSortkeyCountArgs) IsSetHashKey() bool {
	return p.HashKey != nil
}

func (p *RrdbSortkeyCountArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbSortkeyCountArgs) ReadField1(iprot thrift.TProtocol) error {
	p.HashKey = &base.Blob{}
	if err := p.HashKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HashKey), err)
	}
	return nil
}

func (p *RrdbSortkeyCountArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("sortkey_count_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbSortkeyCountArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hash_key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hash_key: ", p), err)
	}
	if err := p.HashKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HashKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hash_key: ", p), err)
	}
	return err
}

func (p *RrdbSortkeyCountArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbSortkeyCountArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbSortkeyCountResult struct {
	Success *CountResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbSortkeyCountResult() *RrdbSortkeyCountResult {
	return &RrdbSortkeyCountResult{}
}

var RrdbSortkeyCountResult_Success_DEFAULT *CountResponse

func (p *RrdbSortkeyCountResult) GetSuccess() *CountResponse {
	if !p.IsSetSuccess() {
		return RrdbSortkeyCountResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbSortkeyCountResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbSortkeyCountResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbSortkeyCountResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &CountResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbSortkeyCountResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("sortkey_count_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbSortkeyCountResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbSortkeyCountResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbSortkeyCountResult(%+v)", *p)
}

// Attributes:
//  - Key
type RrdbTTLArgs struct {
	Key *base.Blob `thrift:"key,1" db:"key" json:"key"`
}

func NewRrdbTTLArgs() *RrdbTTLArgs {
	return &RrdbTTLArgs{}
}

var RrdbTTLArgs_Key_DEFAULT *base.Blob

func (p *RrdbTTLArgs) GetKey() *base.Blob {
	if !p.IsSetKey() {
		return RrdbTTLArgs_Key_DEFAULT
	}
	return p.Key
}
func (p *RrdbTTLArgs) IsSetKey() bool {
	return p.Key != nil
}

func (p *RrdbTTLArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbTTLArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Key = &base.Blob{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *RrdbTTLArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ttl_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbTTLArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *RrdbTTLArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbTTLArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbTTLResult struct {
	Success *TTLResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbTTLResult() *RrdbTTLResult {
	return &RrdbTTLResult{}
}

var RrdbTTLResult_Success_DEFAULT *TTLResponse

func (p *RrdbTTLResult) GetSuccess() *TTLResponse {
	if !p.IsSetSuccess() {
		return RrdbTTLResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbTTLResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbTTLResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbTTLResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &TTLResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbTTLResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ttl_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbTTLResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbTTLResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbTTLResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbGetScannerArgs struct {
	Request *GetScannerRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbGetScannerArgs() *RrdbGetScannerArgs {
	return &RrdbGetScannerArgs{}
}

var RrdbGetScannerArgs_Request_DEFAULT *GetScannerRequest

func (p *RrdbGetScannerArgs) GetRequest() *GetScannerRequest {
	if !p.IsSetRequest() {
		return RrdbGetScannerArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbGetScannerArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbGetScannerArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbGetScannerArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &GetScannerRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbGetScannerArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("get_scanner_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbGetScannerArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbGetScannerArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbGetScannerArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbGetScannerResult struct {
	Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbGetScannerResult() *RrdbGetScannerResult {
	return &RrdbGetScannerResult{}
}

var RrdbGetScannerResult_Success_DEFAULT *ScanResponse

func (p *RrdbGetScannerResult) GetSuccess() *ScanResponse {
	if !p.IsSetSuccess() {
		return RrdbGetScannerResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbGetScannerResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbGetScannerResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbGetScannerResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &ScanResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbGetScannerResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("get_scanner_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbGetScannerResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbGetScannerResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbGetScannerResult(%+v)", *p)
}

// Attributes:
//  - Request
type RrdbScanArgs struct {
	Request *ScanRequest `thrift:"request,1" db:"request" json:"request"`
}

func NewRrdbScanArgs() *RrdbScanArgs {
	return &RrdbScanArgs{}
}

var RrdbScanArgs_Request_DEFAULT *ScanRequest

func (p *RrdbScanArgs) GetRequest() *ScanRequest {
	if !p.IsSetRequest() {
		return RrdbScanArgs_Request_DEFAULT
	}
	return p.Request
}
func (p *RrdbScanArgs) IsSetRequest() bool {
	return p.Request != nil
}

func (p *RrdbScanArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbScanArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Request = &ScanRequest{}
	if err := p.Request.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err)
	}
	return nil
}

func (p *RrdbScanArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("scan_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbScanArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err)
	}
	if err := p.Request.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err)
	}
	return err
}

func (p *RrdbScanArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbScanArgs(%+v)", *p)
}

// Attributes:
//  - Success
type RrdbScanResult struct {
	Success *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewRrdbScanResult() *RrdbScanResult {
	return &RrdbScanResult{}
}

var RrdbScanResult_Success_DEFAULT *ScanResponse

func (p *RrdbScanResult) GetSuccess() *ScanResponse {
	if !p.IsSetSuccess() {
		return RrdbScanResult_Success_DEFAULT
	}
	return p.Success
}
func (p *RrdbScanResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *RrdbScanResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbScanResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &ScanResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *RrdbScanResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("scan_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbScanResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *RrdbScanResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbScanResult(%+v)", *p)
}

// Attributes:
//  - ContextID
type RrdbClearScannerArgs struct {
	ContextID int64 `thrift:"context_id,1" db:"context_id" json:"context_id"`
}

func NewRrdbClearScannerArgs() *RrdbClearScannerArgs {
	return &RrdbClearScannerArgs{}
}

func (p *RrdbClearScannerArgs) GetContextID() int64 {
	return p.ContextID
}
func (p *RrdbClearScannerArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RrdbClearScannerArgs) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ContextID = v
	}
	return nil
}

func (p *RrdbClearScannerArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("clear_scanner_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RrdbClearScannerArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("context_id", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:context_id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.ContextID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.context_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:context_id: ", p), err)
	}
	return err
}

func (p *RrdbClearScannerArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RrdbClearScannerArgs(%+v)", *p)
}

type Meta interface {
	// Parameters:
	//  - Query
	QueryCfg(ctx context.Context, query *replication.QueryCfgRequest) (r *replication.QueryCfgResponse, err error)
}

type MetaClient struct {
	c thrift.TClient
}

func NewMetaClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MetaClient {
	return &MetaClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

func NewMetaClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MetaClient {
	return &MetaClient{
		c: thrift.NewTStandardClient(iprot, oprot),
	}
}

func NewMetaClient(c thrift.TClient) *MetaClient {
	return &MetaClient{
		c: c,
	}
}

func (p *MetaClient) Client_() thrift.TClient {
	return p.c
}

// Parameters:
//  - Query
func (p *MetaClient) QueryCfg(ctx context.Context, query *replication.QueryCfgRequest) (r *replication.QueryCfgResponse, err error) {
	var _args124 MetaQueryCfgArgs
	_args124.Query = query
	var _result125 MetaQueryCfgResult
	if err = p.Client_().Call(ctx, "query_cfg", &_args124, &_result125); err != nil {
		return
	}
	return _result125.GetSuccess(), nil
}

type MetaProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      Meta
}

func (p *MetaProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
	p.processorMap[key] = processor
}

func (p *MetaProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
	processor, ok = p.processorMap[key]
	return processor, ok
}

func (p *MetaProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
	return p.processorMap
}

func NewMetaProcessor(handler Meta) *MetaProcessor {

	self126 := &MetaProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self126.processorMap["query_cfg"] = &metaProcessorQueryCfg{handler: handler}
	return self126
}

func (p *MetaProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	name, _, seqId, err := iprot.ReadMessageBegin()
	if err != nil {
		return false, err
	}
	if processor, ok := p.GetProcessorFunction(name); ok {
		return processor.Process(ctx, seqId, iprot, oprot)
	}
	iprot.Skip(thrift.STRUCT)
	iprot.ReadMessageEnd()
	x127 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x127.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush(ctx)
	return false, x127

}

type metaProcessorQueryCfg struct {
	handler Meta
}

func (p *metaProcessorQueryCfg) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := MetaQueryCfgArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("query_cfg", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	result := MetaQueryCfgResult{}
	var retval *replication.QueryCfgResponse
	var err2 error
	if retval, err2 = p.handler.QueryCfg(ctx, args.Query); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query_cfg: "+err2.Error())
		oprot.WriteMessageBegin("query_cfg", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("query_cfg", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

// HELPER FUNCTIONS AND STRUCTURES

// Attributes:
//  - Query
type MetaQueryCfgArgs struct {
	Query *replication.QueryCfgRequest `thrift:"query,1" db:"query" json:"query"`
}

func NewMetaQueryCfgArgs() *MetaQueryCfgArgs {
	return &MetaQueryCfgArgs{}
}

var MetaQueryCfgArgs_Query_DEFAULT *replication.QueryCfgRequest

func (p *MetaQueryCfgArgs) GetQuery() *replication.QueryCfgRequest {
	if !p.IsSetQuery() {
		return MetaQueryCfgArgs_Query_DEFAULT
	}
	return p.Query
}
func (p *MetaQueryCfgArgs) IsSetQuery() bool {
	return p.Query != nil
}

func (p *MetaQueryCfgArgs) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MetaQueryCfgArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Query = &replication.QueryCfgRequest{}
	if err := p.Query.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err)
	}
	return nil
}

func (p *MetaQueryCfgArgs) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("query_cfg_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField1(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MetaQueryCfgArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err)
	}
	if err := p.Query.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err)
	}
	return err
}

func (p *MetaQueryCfgArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MetaQueryCfgArgs(%+v)", *p)
}

// Attributes:
//  - Success
type MetaQueryCfgResult struct {
	Success *replication.QueryCfgResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewMetaQueryCfgResult() *MetaQueryCfgResult {
	return &MetaQueryCfgResult{}
}

var MetaQueryCfgResult_Success_DEFAULT *replication.QueryCfgResponse

func (p *MetaQueryCfgResult) GetSuccess() *replication.QueryCfgResponse {
	if !p.IsSetSuccess() {
		return MetaQueryCfgResult_Success_DEFAULT
	}
	return p.Success
}
func (p *MetaQueryCfgResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *MetaQueryCfgResult) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MetaQueryCfgResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = &replication.QueryCfgResponse{}
	if err := p.Success.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
	}
	return nil
}

func (p *MetaQueryCfgResult) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("query_cfg_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MetaQueryCfgResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *MetaQueryCfgResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MetaQueryCfgResult(%+v)", *p)
}
