mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge 3e5173b9c89d43551c14eeab77c64a0993bb4284 into c86c93ca2951338115159dcdd20711603044e1f1
This commit is contained in:
commit
063a601e1a
@ -72,17 +72,17 @@ func (as *InternalRaftStringer) String() string {
|
|||||||
return as.Request.String()
|
return as.Request.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// txnRequestStringer implements a custom proto String to replace value bytes fields with value size
|
// TxnRequestStringer implements a custom proto String to replace value bytes fields with value size
|
||||||
// fields in any nested txn and put operations.
|
// fields in any nested txn and put operations.
|
||||||
type txnRequestStringer struct {
|
type TxnRequestStringer struct {
|
||||||
Request *TxnRequest
|
Request *TxnRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer {
|
func NewLoggableTxnRequest(request *TxnRequest) *TxnRequestStringer {
|
||||||
return &txnRequestStringer{request}
|
return &TxnRequestStringer{request}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (as *txnRequestStringer) String() string {
|
func (as *TxnRequestStringer) String() string {
|
||||||
var compare []string
|
var compare []string
|
||||||
for _, c := range as.Request.Compare {
|
for _, c := range as.Request.Compare {
|
||||||
switch cv := c.TargetUnion.(type) {
|
switch cv := c.TargetUnion.(type) {
|
||||||
@ -155,10 +155,10 @@ func (m *loggableValueCompare) Reset() { *m = loggableValueCompare{} }
|
|||||||
func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) }
|
func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) }
|
||||||
func (*loggableValueCompare) ProtoMessage() {}
|
func (*loggableValueCompare) ProtoMessage() {}
|
||||||
|
|
||||||
// loggablePutRequest implements a custom proto String to replace value bytes field with a value
|
// LoggablePutRequest implements a custom proto String to replace value bytes field with a value
|
||||||
// size field.
|
// size field.
|
||||||
// To preserve proto encoding of the key bytes, a faked out proto type is used here.
|
// To preserve proto encoding of the key bytes, a faked out proto type is used here.
|
||||||
type loggablePutRequest struct {
|
type LoggablePutRequest struct {
|
||||||
Key []byte `protobuf:"bytes,1,opt,name=key,proto3"`
|
Key []byte `protobuf:"bytes,1,opt,name=key,proto3"`
|
||||||
ValueSize int64 `protobuf:"varint,2,opt,name=value_size,proto3"`
|
ValueSize int64 `protobuf:"varint,2,opt,name=value_size,proto3"`
|
||||||
Lease int64 `protobuf:"varint,3,opt,name=lease,proto3"`
|
Lease int64 `protobuf:"varint,3,opt,name=lease,proto3"`
|
||||||
@ -167,8 +167,8 @@ type loggablePutRequest struct {
|
|||||||
IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"`
|
IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest {
|
func NewLoggablePutRequest(request *PutRequest) *LoggablePutRequest {
|
||||||
return &loggablePutRequest{
|
return &LoggablePutRequest{
|
||||||
request.Key,
|
request.Key,
|
||||||
int64(len(request.Value)),
|
int64(len(request.Value)),
|
||||||
request.Lease,
|
request.Lease,
|
||||||
@ -178,6 +178,6 @@ func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *loggablePutRequest) Reset() { *m = loggablePutRequest{} }
|
func (m *LoggablePutRequest) Reset() { *m = LoggablePutRequest{} }
|
||||||
func (m *loggablePutRequest) String() string { return proto.CompactTextString(m) }
|
func (m *LoggablePutRequest) String() string { return proto.CompactTextString(m) }
|
||||||
func (*loggablePutRequest) ProtoMessage() {}
|
func (*LoggablePutRequest) ProtoMessage() {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user