// Autogenerated by Thrift Compiler (0.11.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/XiaoMi/pegasus-go-client/idl/base"
	"github.com/XiaoMi/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 _ = base.GoUnusedProtection__
var _ = replication.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
}

// Attributes:
//  - Key
//  - Value
//  - ExpireTsSeconds
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"`
}

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
}
func (p *UpdateRequest) IsSetKey() bool {
	return p.Key != nil
}

func (p *UpdateRequest) IsSetValue() bool {
	return p.Value != 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
				}
			}
		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) 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 := 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) 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
type KeyValue struct {
	Key   *base.Blob `thrift:"key,1" db:"key" json:"key"`
	Value *base.Blob `thrift:"value,2" db:"value" json:"value"`
}

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
}
func (p *KeyValue) IsSetKey() bool {
	return p.Key != nil
}

func (p *KeyValue) IsSetValue() bool {
	return p.Value != 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
				}
			}
		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) 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 := 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) 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
//  - SorkKeys
//  - MaxCount
type MultiRemoveRequest struct {
	HashKey  *base.Blob   `thrift:"hash_key,1" db:"hash_key" json:"hash_key"`
	SorkKeys []*base.Blob `thrift:"sork_keys,2" db:"sork_keys" json:"sork_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) GetSorkKeys() []*base.Blob {
	return p.SorkKeys
}

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.SorkKeys = 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.SorkKeys = append(p.SorkKeys, _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("sork_keys", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sork_keys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SorkKeys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.SorkKeys {
		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:sork_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
//  - SorkKeys
//  - 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"`
	SorkKeys             []*base.Blob `thrift:"sork_keys,2" db:"sork_keys" json:"sork_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) GetSorkKeys() []*base.Blob {
	return p.SorkKeys
}

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.SorkKeys = 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.SorkKeys = append(p.SorkKeys, _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("sork_keys", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sork_keys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SorkKeys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.SorkKeys {
		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:sork_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:
//  - Key
//  - Increment
type IncrRequest struct {
	Key       *base.Blob `thrift:"key,1" db:"key" json:"key"`
	Increment int64      `thrift:"increment,2" db:"increment" json:"increment"`
}

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) 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
				}
			}
		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) 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 := 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) 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:
//  - StartKey
//  - StopKey
//  - StartInclusive
//  - StopInclusive
//  - BatchSize
//  - NoValue
//  - HashKeyFilterType
//  - HashKeyFilterPattern
//  - SortKeyFilterType
//  - SortKeyFilterPattern
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"`
}

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
}
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) 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
				}
			}
		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) 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 := 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) 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
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"`
}

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
}
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
				}
			}
		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++ {
		_elem4 := &KeyValue{}
		if err := _elem4.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err)
		}
		p.Kvs = append(p.Kvs, _elem4)
	}
	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) 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 := 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) 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:
	//  - 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:
	//  - 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
}

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

// Deprecated: Use NewRrdb instead
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,
	}
}

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

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

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

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

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

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

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

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

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

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

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

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

// Parameters:
//  - ContextID
func (p *RrdbClient) ClearScanner(ctx context.Context, context_id int64) (err error) {
	var _args29 RrdbClearScannerArgs
	_args29.ContextID = context_id
	if err := p.c.Call(ctx, "clear_scanner", &_args29, 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 {

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

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()
	x31 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x31.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush()
	return false, x31

}

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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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()
		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()
		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(); 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:
//  - 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:
//  - 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
}

// Deprecated: Use NewMeta instead
func NewMetaClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MetaClient {
	return &MetaClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

// Deprecated: Use NewMeta instead
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,
	}
}

// Parameters:
//  - Query
func (p *MetaClient) QueryCfg(ctx context.Context, query *replication.QueryCfgRequest) (r *replication.QueryCfgResponse, err error) {
	var _args105 MetaQueryCfgArgs
	_args105.Query = query
	var _result106 MetaQueryCfgResult
	if err = p.c.Call(ctx, "query_cfg", &_args105, &_result106); err != nil {
		return
	}
	return _result106.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 {

	self107 := &MetaProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self107.processorMap["query_cfg"] = &metaProcessorQueryCfg{handler: handler}
	return self107
}

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()
	x108 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x108.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush()
	return false, x108

}

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()
		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()
		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(); 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)
}
