func (ti *transInfo) PutTransStrInfo(kvInfo map[string]string) {
	if kvInfo == nil {
		return
	}
	if len(ti.strInfo) == 0 {
		ti.strInfo = kvInfo
	} else {
		for k, v := range kvInfo {
			ti.strInfo[k] = v
		}
	}
}
PutTransStrInfo implements the TransInfo interface.
package remote
import (
	"sync"
	"github.com/cloudwego/kitex/pkg/rpcinfo"
	"github.com/cloudwego/kitex/pkg/serviceinfo"
	"github.com/cloudwego/kitex/transport"
)
var (
	messagePool      sync.Pool
	transInfoPool    sync.Pool
	emptyServiceInfo serviceinfo.ServiceInfo
)
func init() {
	messagePool.New = newMessage
	transInfoPool.New = newTransInfo
}
type MessageType int32
const (
	InvalidMessageType MessageType = 0
	Call               MessageType = 1
	Reply              MessageType = 2
	Exception          MessageType = 3
	Oneway MessageType = 4
	Stream MessageType = 5
)
const (
	ReadFailed string = "RFailed"
	MeshHeader string = "mHeader"
)
var emptyProtocolInfo ProtocolInfo
type ProtocolInfo struct {
	TransProto transport.Protocol
	CodecType  serviceinfo.PayloadCodec
}
func NewProtocolInfo(tp transport.Protocol, ct serviceinfo.PayloadCodec) ProtocolInfo {
	return ProtocolInfo{
		TransProto: tp,
		CodecType:  ct,
	}
}
type Message interface {
	RPCInfo() rpcinfo.RPCInfo
	ServiceInfo() *serviceinfo.ServiceInfo
	Data() interface{}
	NewData(method string) (ok bool)
	MessageType() MessageType
	SetMessageType(MessageType)
	RPCRole() RPCRole
	PayloadLen() int
	SetPayloadLen(size int)
	TransInfo() TransInfo
	Tags() map[string]interface{}
	ProtocolInfo() ProtocolInfo
	SetProtocolInfo(ProtocolInfo)
	PayloadCodec() PayloadCodec
	SetPayloadCodec(pc PayloadCodec)
	Recycle()
}
func NewMessage(data interface{}, svcInfo *serviceinfo.ServiceInfo, ri rpcinfo.RPCInfo, msgType MessageType, rpcRole RPCRole) Message {
	msg := messagePool.Get().(*message)
	msg.data = data
	msg.rpcInfo = ri
	msg.svcInfo = svcInfo
	msg.msgType = msgType
	msg.rpcRole = rpcRole
	msg.transInfo = transInfoPool.Get().(*transInfo)
	return msg
}
func NewMessageWithNewer(svcInfo *serviceinfo.ServiceInfo, ri rpcinfo.RPCInfo, msgType MessageType, rpcRole RPCRole) Message {
	msg := messagePool.Get().(*message)
	msg.rpcInfo = ri
	msg.svcInfo = svcInfo
	msg.msgType = msgType
	msg.rpcRole = rpcRole
	msg.transInfo = transInfoPool.Get().(*transInfo)
	return msg
}
func RecycleMessage(msg Message) {
	if msg != nil {
		msg.Recycle()
	}
}
func newMessage() interface{} {
	return &message{tags: make(map[string]interface{})}
}
type message struct {
	msgType      MessageType
	data         interface{}
	rpcInfo      rpcinfo.RPCInfo
	svcInfo      *serviceinfo.ServiceInfo
	rpcRole      RPCRole
	compressType CompressType
	payloadSize  int
	transInfo    TransInfo
	tags         map[string]interface{}
	protocol     ProtocolInfo
	payloadCodec PayloadCodec
}
func (m *message) zero() {
	m.msgType = InvalidMessageType
	m.data = nil
	m.rpcInfo = nil
	m.svcInfo = &emptyServiceInfo
	m.rpcRole = -1
	m.compressType = NoCompress
	m.payloadSize = 0
	if m.transInfo != nil {
		m.transInfo.Recycle()
		m.transInfo = nil
	}
	for k := range m.tags {
		delete(m.tags, k)
	}
	m.protocol = emptyProtocolInfo
}
func (m *message) RPCInfo() rpcinfo.RPCInfo {
	return m.rpcInfo
}
func (m *message) ServiceInfo() *serviceinfo.ServiceInfo {
	return m.svcInfo
}
func (m *message) Data() interface{} {
	return m.data
}
func (m *message) NewData(method string) (ok bool) {
	if m.data != nil {
		return false
	}
	if mt := m.svcInfo.MethodInfo(method); mt != nil {
		m.data = mt.NewArgs()
	}
	if m.data == nil {
		return false
	}
	return true
}
func (m *message) MessageType() MessageType {
	return m.msgType
}
func (m *message) SetMessageType(mt MessageType) {
	m.msgType = mt
}
func (m *message) RPCRole() RPCRole {
	return m.rpcRole
}
func (m *message) TransInfo() TransInfo {
	return m.transInfo
}
func (m *message) Tags() map[string]interface{} {
	return m.tags
}
func (m *message) PayloadLen() int {
	return m.payloadSize
}
func (m *message) SetPayloadLen(size int) {
	m.payloadSize = size
}
func (m *message) ProtocolInfo() ProtocolInfo {
	return m.protocol
}
func (m *message) SetProtocolInfo(pt ProtocolInfo) {
	m.protocol = pt
}
func (m *message) PayloadCodec() PayloadCodec {
	return m.payloadCodec
}
func (m *message) SetPayloadCodec(pc PayloadCodec) {
	m.payloadCodec = pc
}
func (m *message) Recycle() {
	m.zero()
	messagePool.Put(m)
}
type TransInfo interface {
	TransStrInfo() map[string]string
	TransIntInfo() map[uint16]string
	PutTransIntInfo(map[uint16]string)
	PutTransStrInfo(kvInfo map[string]string)
	Recycle()
}
func newTransInfo() interface{} {
	return &transInfo{
		intInfo: make(map[uint16]string),
		strInfo: make(map[string]string),
	}
}
type transInfo struct {
	strInfo map[string]string
	intInfo map[uint16]string
}
func (ti *transInfo) zero() {
	for k := range ti.intInfo {
		delete(ti.intInfo, k)
	}
	for k := range ti.strInfo {
		delete(ti.strInfo, k)
	}
}
func (ti *transInfo) TransIntInfo() map[uint16]string {
	return ti.intInfo
}
func (ti *transInfo) PutTransIntInfo(kvInfo map[uint16]string) {
	if kvInfo == nil {
		return
	}
	if len(ti.intInfo) == 0 {
		ti.intInfo = kvInfo
	} else {
		for k, v := range kvInfo {
			ti.intInfo[k] = v
		}
	}
}
func (ti *transInfo) TransStrInfo() map[string]string {
	return ti.strInfo
}