mirror of https://github.com/etcd-io/dbtester.git
Merge pull request #353 from gyuho/update
*: updates on vendor, configs
This commit is contained in:
commit
c55c1a6d2c
|
|
@ -81,7 +81,7 @@ func startConsul(fs *flags, t *transporterServer) error {
|
|||
}
|
||||
}
|
||||
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_3:
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_4:
|
||||
switch t.req.IPIndex {
|
||||
case 0: // leader
|
||||
flags = []string{
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ func startEtcd(fs *flags, t *transporterServer) error {
|
|||
"--listen-peer-urls", peerURLs[t.req.IPIndex],
|
||||
"--initial-advertise-peer-urls", peerURLs[t.req.IPIndex],
|
||||
|
||||
"--initial-cluster-token", "dbtester-etcd-token",
|
||||
"--initial-cluster-token", "mytoken",
|
||||
"--initial-cluster", strings.Join(members, ","),
|
||||
"--initial-cluster-state", "new",
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ func startEtcd(fs *flags, t *transporterServer) error {
|
|||
"--listen-peer-urls", peerURLs[t.req.IPIndex],
|
||||
"--initial-advertise-peer-urls", peerURLs[t.req.IPIndex],
|
||||
|
||||
"--initial-cluster-token", "dbtester-etcd-token",
|
||||
"--initial-cluster-token", "mytoken",
|
||||
"--initial-cluster", strings.Join(members, ","),
|
||||
"--initial-cluster-state", "new",
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ func startEtcd(fs *flags, t *transporterServer) error {
|
|||
"--listen-peer-urls", peerURLs[t.req.IPIndex],
|
||||
"--initial-advertise-peer-urls", peerURLs[t.req.IPIndex],
|
||||
|
||||
"--initial-cluster-token", "dbtester-etcd-token",
|
||||
"--initial-cluster-token", "mytoken",
|
||||
"--initial-cluster", strings.Join(members, ","),
|
||||
"--initial-cluster-state", "new",
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ func startEtcd(fs *flags, t *transporterServer) error {
|
|||
"--listen-peer-urls", peerURLs[t.req.IPIndex],
|
||||
"--initial-advertise-peer-urls", peerURLs[t.req.IPIndex],
|
||||
|
||||
"--initial-cluster-token", "dbtester-etcd-token",
|
||||
"--initial-cluster-token", "mytoken",
|
||||
"--initial-cluster", strings.Join(members, ","),
|
||||
"--initial-cluster-state", "new",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ func (t *transporterServer) Transfer(ctx context.Context, req *dbtesterpb.Reques
|
|||
|
||||
case dbtesterpb.DatabaseID_consul__v0_7_5,
|
||||
dbtesterpb.DatabaseID_consul__v0_8_0,
|
||||
dbtesterpb.DatabaseID_consul__v0_8_3:
|
||||
dbtesterpb.DatabaseID_consul__v0_8_4:
|
||||
plog.Infof("Consul executable binary path: %q", globalFlags.consulExec)
|
||||
plog.Infof("Consul data directory: %q", globalFlags.consulDataDir)
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ func (t *transporterServer) Transfer(ctx context.Context, req *dbtesterpb.Reques
|
|||
}
|
||||
case dbtesterpb.DatabaseID_consul__v0_7_5,
|
||||
dbtesterpb.DatabaseID_consul__v0_8_0,
|
||||
dbtesterpb.DatabaseID_consul__v0_8_3:
|
||||
dbtesterpb.DatabaseID_consul__v0_8_4:
|
||||
if err := startConsul(&globalFlags, t); err != nil {
|
||||
plog.Errorf("startConsul error %v", err)
|
||||
return nil, err
|
||||
|
|
@ -303,7 +303,7 @@ func measureDatabasSize(flg flags, rdb dbtesterpb.DatabaseID) (int64, error) {
|
|||
return fileinspect.Size(flg.consulDataDir)
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_0:
|
||||
return fileinspect.Size(flg.consulDataDir)
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_3:
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_4:
|
||||
return fileinspect.Size(flg.consulDataDir)
|
||||
case dbtesterpb.DatabaseID_cetcd__beta:
|
||||
return fileinspect.Size(flg.etcdDataDir)
|
||||
|
|
|
|||
|
|
@ -303,14 +303,14 @@ func ReadConfig(fpath string, analyze bool) (*Config, error) {
|
|||
}
|
||||
cfg.DatabaseIDToConfigClientMachineAgentControl[dbtesterpb.DatabaseID_consul__v0_8_0.String()] = v
|
||||
}
|
||||
if v, ok := cfg.DatabaseIDToConfigClientMachineAgentControl[dbtesterpb.DatabaseID_consul__v0_8_3.String()]; ok {
|
||||
if v, ok := cfg.DatabaseIDToConfigClientMachineAgentControl[dbtesterpb.DatabaseID_consul__v0_8_4.String()]; ok {
|
||||
if v.AgentPortToConnect == 0 {
|
||||
v.AgentPortToConnect = defaultAgentPort
|
||||
}
|
||||
if v.DatabasePortToConnect == 0 {
|
||||
v.DatabasePortToConnect = defaultConsulClientPort
|
||||
}
|
||||
cfg.DatabaseIDToConfigClientMachineAgentControl[dbtesterpb.DatabaseID_consul__v0_8_3.String()] = v
|
||||
cfg.DatabaseIDToConfigClientMachineAgentControl[dbtesterpb.DatabaseID_consul__v0_8_4.String()] = v
|
||||
}
|
||||
|
||||
// need etcd configs since it's backed by etcd
|
||||
|
|
@ -453,7 +453,7 @@ func (cfg *Config) ToRequest(databaseID string, op dbtesterpb.Operation, idx int
|
|||
|
||||
case dbtesterpb.DatabaseID_consul__v0_7_5:
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_0:
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_3:
|
||||
case dbtesterpb.DatabaseID_consul__v0_8_4:
|
||||
|
||||
case dbtesterpb.DatabaseID_zetcd__beta:
|
||||
case dbtesterpb.DatabaseID_cetcd__beta:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
Flag_Cetcd_Beta
|
||||
Flag_Consul_V0_7_5
|
||||
Flag_Consul_V0_8_0
|
||||
Flag_Consul_V0_8_3
|
||||
Flag_Consul_V0_8_4
|
||||
Flag_Etcd_V2_3
|
||||
Flag_Etcd_V3_1
|
||||
Flag_Etcd_V3_2
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ type ConfigClientMachineAgentControl struct {
|
|||
Flag_Zookeeper_R3_5_3Beta *Flag_Zookeeper_R3_5_3Beta `protobuf:"bytes,202,opt,name=flag__zookeeper__r3_5_3_beta,json=flagZookeeperR353Beta" json:"flag__zookeeper__r3_5_3_beta,omitempty" yaml:"zookeeper__r3_5_3_beta"`
|
||||
Flag_Consul_V0_7_5 *Flag_Consul_V0_7_5 `protobuf:"bytes,300,opt,name=flag__consul__v0_7_5,json=flagConsulV075" json:"flag__consul__v0_7_5,omitempty" yaml:"consul__v0_7_5"`
|
||||
Flag_Consul_V0_8_0 *Flag_Consul_V0_8_0 `protobuf:"bytes,301,opt,name=flag__consul__v0_8_0,json=flagConsulV080" json:"flag__consul__v0_8_0,omitempty" yaml:"consul__v0_8_0"`
|
||||
Flag_Consul_V0_8_3 *Flag_Consul_V0_8_3 `protobuf:"bytes,302,opt,name=flag__consul__v0_8_3,json=flagConsulV083" json:"flag__consul__v0_8_3,omitempty" yaml:"consul__v0_8_3"`
|
||||
Flag_Consul_V0_8_4 *Flag_Consul_V0_8_4 `protobuf:"bytes,302,opt,name=flag__consul__v0_8_4,json=flagConsulV084" json:"flag__consul__v0_8_4,omitempty" yaml:"consul__v0_8_4"`
|
||||
Flag_Cetcd_Beta *Flag_Cetcd_Beta `protobuf:"bytes,400,opt,name=flag__cetcd__beta,json=flagCetcdBeta" json:"flag__cetcd__beta,omitempty" yaml:"cetcd__beta"`
|
||||
Flag_Zetcd_Beta *Flag_Zetcd_Beta `protobuf:"bytes,500,opt,name=flag__zetcd__beta,json=flagZetcdBeta" json:"flag__zetcd__beta,omitempty" yaml:"zetcd__beta"`
|
||||
ConfigClientMachineBenchmarkOptions *ConfigClientMachineBenchmarkOptions `protobuf:"bytes,1000,opt,name=ConfigClientMachineBenchmarkOptions" json:"ConfigClientMachineBenchmarkOptions,omitempty" yaml:"benchmark_options"`
|
||||
|
|
@ -587,13 +587,13 @@ func (m *ConfigClientMachineAgentControl) MarshalTo(dAtA []byte) (int, error) {
|
|||
}
|
||||
i += n11
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 != nil {
|
||||
if m.Flag_Consul_V0_8_4 != nil {
|
||||
dAtA[i] = 0xf2
|
||||
i++
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintConfigClientMachine(dAtA, i, uint64(m.Flag_Consul_V0_8_3.Size()))
|
||||
n12, err := m.Flag_Consul_V0_8_3.MarshalTo(dAtA[i:])
|
||||
i = encodeVarintConfigClientMachine(dAtA, i, uint64(m.Flag_Consul_V0_8_4.Size()))
|
||||
n12, err := m.Flag_Consul_V0_8_4.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
@ -881,8 +881,8 @@ func (m *ConfigClientMachineAgentControl) Size() (n int) {
|
|||
l = m.Flag_Consul_V0_8_0.Size()
|
||||
n += 2 + l + sovConfigClientMachine(uint64(l))
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 != nil {
|
||||
l = m.Flag_Consul_V0_8_3.Size()
|
||||
if m.Flag_Consul_V0_8_4 != nil {
|
||||
l = m.Flag_Consul_V0_8_4.Size()
|
||||
n += 2 + l + sovConfigClientMachine(uint64(l))
|
||||
}
|
||||
if m.Flag_Cetcd_Beta != nil {
|
||||
|
|
@ -2396,7 +2396,7 @@ func (m *ConfigClientMachineAgentControl) Unmarshal(dAtA []byte) error {
|
|||
iNdEx = postIndex
|
||||
case 302:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Flag_Consul_V0_8_3", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Flag_Consul_V0_8_4", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
|
@ -2420,10 +2420,10 @@ func (m *ConfigClientMachineAgentControl) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 == nil {
|
||||
m.Flag_Consul_V0_8_3 = &Flag_Consul_V0_8_3{}
|
||||
if m.Flag_Consul_V0_8_4 == nil {
|
||||
m.Flag_Consul_V0_8_4 = &Flag_Consul_V0_8_4{}
|
||||
}
|
||||
if err := m.Flag_Consul_V0_8_3.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
if err := m.Flag_Consul_V0_8_4.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
|
@ -2693,116 +2693,116 @@ var fileDescriptorConfigClientMachine = []byte{
|
|||
// 1811 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0x6d, 0x6f, 0x1b, 0x49,
|
||||
0x1d, 0x3f, 0x37, 0xed, 0x35, 0x99, 0xf4, 0x29, 0xd3, 0xa6, 0x71, 0xd3, 0x34, 0x93, 0x6e, 0x5a,
|
||||
0x2e, 0xd5, 0xd1, 0x3c, 0x78, 0xd3, 0xbb, 0x16, 0x81, 0xa0, 0x4e, 0x0e, 0xa8, 0x9a, 0xbb, 0x0b,
|
||||
0xeb, 0x5c, 0x11, 0x15, 0x62, 0x18, 0xaf, 0x27, 0xeb, 0xbd, 0xac, 0x77, 0x96, 0x9d, 0x71, 0x84,
|
||||
0xc3, 0x5b, 0x24, 0x04, 0x12, 0xd2, 0xbd, 0xbc, 0x97, 0x7c, 0x00, 0xe0, 0x63, 0xa0, 0xc2, 0x2b,
|
||||
0xbe, 0x00, 0x2b, 0x68, 0xdf, 0xc0, 0xdb, 0x15, 0x1f, 0xe0, 0x34, 0xff, 0x59, 0xdb, 0x6b, 0x7b,
|
||||
0xed, 0xf8, 0x9d, 0x77, 0xfe, 0xbf, 0xa7, 0x99, 0x9d, 0xa7, 0x35, 0xfa, 0x56, 0xa3, 0xae, 0xb8,
|
||||
0x54, 0x3c, 0x8e, 0xea, 0x5b, 0xae, 0x08, 0x8f, 0x7d, 0x8f, 0xba, 0x81, 0xcf, 0x43, 0x45, 0x5b,
|
||||
0xcc, 0x6d, 0xfa, 0x21, 0xdf, 0x8c, 0x62, 0xa1, 0x04, 0x46, 0x7d, 0xdc, 0xf2, 0x63, 0xcf, 0x57,
|
||||
0xcd, 0x76, 0x7d, 0xd3, 0x15, 0xad, 0x2d, 0x4f, 0x78, 0x62, 0x0b, 0x20, 0xf5, 0xf6, 0x31, 0x3c,
|
||||
0xc1, 0x03, 0xfc, 0x32, 0xd4, 0xe5, 0xe5, 0x9c, 0xc5, 0x71, 0xc0, 0x3c, 0xca, 0x95, 0xdb, 0xc8,
|
||||
0x6a, 0x64, 0xb8, 0x76, 0x26, 0xc4, 0x09, 0xe7, 0x11, 0x8f, 0x33, 0xc0, 0xca, 0x30, 0xc0, 0x15,
|
||||
0xa1, 0x6c, 0x07, 0x59, 0xf5, 0xee, 0x08, 0x3d, 0xa7, 0x3d, 0x52, 0x74, 0xfb, 0x45, 0xeb, 0xdd,
|
||||
0x15, 0xb4, 0xbc, 0x07, 0xfd, 0xdd, 0x83, 0xee, 0x7e, 0x6a, 0x7a, 0xfb, 0x22, 0xf4, 0x95, 0xcf,
|
||||
0x02, 0xfc, 0x11, 0x42, 0x87, 0x4c, 0x35, 0x0f, 0x63, 0x7e, 0xec, 0xff, 0xba, 0x5c, 0x5a, 0x2b,
|
||||
0x6d, 0xcc, 0x55, 0x6f, 0xa7, 0x09, 0xc1, 0x1d, 0xd6, 0x0a, 0xbe, 0x63, 0x45, 0x4c, 0x35, 0x69,
|
||||
0x04, 0x45, 0xcb, 0xc9, 0x21, 0xf1, 0x63, 0x74, 0xf9, 0x40, 0x78, 0xba, 0xa1, 0x7c, 0x01, 0x48,
|
||||
0x37, 0xd3, 0x84, 0x5c, 0x37, 0xa4, 0x40, 0x78, 0x54, 0x13, 0x2d, 0xa7, 0x8b, 0xc1, 0x14, 0x2d,
|
||||
0x19, 0xfb, 0x5a, 0x47, 0x2a, 0xde, 0xfa, 0x94, 0xab, 0xd8, 0x77, 0x25, 0xd0, 0x67, 0x80, 0xfe,
|
||||
0x30, 0x4d, 0xc8, 0x7d, 0x43, 0xcf, 0x5e, 0x8b, 0x04, 0x24, 0x6d, 0x19, 0x68, 0x26, 0x38, 0x4e,
|
||||
0x05, 0xff, 0xb6, 0x84, 0xd6, 0x0b, 0x6a, 0x2f, 0x42, 0x3d, 0x2c, 0x22, 0x60, 0x8a, 0x37, 0xc0,
|
||||
0xed, 0x22, 0xb8, 0x55, 0xd2, 0x84, 0x6c, 0x4e, 0x72, 0xf3, 0x73, 0xbc, 0xcc, 0x7a, 0x1a, 0x79,
|
||||
0xfc, 0x87, 0x12, 0x7a, 0x68, 0x70, 0x07, 0x4c, 0xf1, 0xd0, 0xed, 0x1c, 0x35, 0x63, 0xd1, 0xf6,
|
||||
0x9a, 0x51, 0x5b, 0x1d, 0xf9, 0x2d, 0x2e, 0x79, 0xec, 0x73, 0xd3, 0xed, 0x4b, 0x10, 0x64, 0x37,
|
||||
0x4d, 0xc8, 0xf6, 0x40, 0x90, 0xc0, 0xf0, 0xa8, 0xea, 0x11, 0xa9, 0xea, 0x31, 0xb3, 0x28, 0xd3,
|
||||
0x59, 0xe0, 0xdf, 0xa0, 0xb5, 0x01, 0xe0, 0xbe, 0x2f, 0x55, 0xec, 0xd7, 0xdb, 0xca, 0x17, 0xe1,
|
||||
0xf3, 0x20, 0x80, 0x18, 0xef, 0x43, 0x8c, 0xad, 0x34, 0x21, 0x1f, 0x16, 0xc6, 0x68, 0xe4, 0x38,
|
||||
0x94, 0x05, 0x41, 0x96, 0xe0, 0x5c, 0x61, 0xfc, 0x55, 0x09, 0x7d, 0x30, 0x16, 0x74, 0xc8, 0x63,
|
||||
0x97, 0x87, 0xca, 0x0f, 0x38, 0x84, 0xb8, 0x0c, 0x21, 0x3e, 0x4a, 0x13, 0x52, 0x39, 0x3f, 0x44,
|
||||
0xd4, 0xe3, 0x66, 0x59, 0xa6, 0xb5, 0xc1, 0xbf, 0x2b, 0xa1, 0x07, 0x63, 0xb1, 0xb5, 0x76, 0xab,
|
||||
0xc5, 0xe2, 0x0e, 0xe4, 0x99, 0x85, 0x3c, 0x76, 0x9a, 0x90, 0xad, 0xf3, 0xf3, 0x48, 0x43, 0xcc,
|
||||
0xc2, 0x4c, 0x65, 0x80, 0x23, 0xb4, 0x32, 0x80, 0xab, 0x76, 0x5e, 0xf2, 0xce, 0x67, 0xed, 0x56,
|
||||
0x9d, 0xc7, 0x10, 0x60, 0x0e, 0x02, 0x7c, 0x3b, 0x4d, 0xc8, 0x46, 0x61, 0x80, 0x7a, 0x87, 0x9e,
|
||||
0xf0, 0x0e, 0x0d, 0x81, 0x91, 0x39, 0x4f, 0x54, 0xc4, 0x1d, 0x44, 0x6a, 0x3c, 0x3e, 0xe5, 0xf1,
|
||||
0xbe, 0x2f, 0x4f, 0x6a, 0x11, 0x73, 0xf9, 0x17, 0x92, 0x79, 0x3c, 0xdf, 0x6b, 0x34, 0x3c, 0x15,
|
||||
0x24, 0x10, 0x74, 0x6f, 0x4f, 0xa8, 0xd4, 0x14, 0xda, 0xd6, 0x9c, 0xa1, 0x1e, 0x9f, 0xa7, 0x8b,
|
||||
0x7f, 0x8e, 0x6e, 0xff, 0x48, 0x08, 0x2f, 0xe0, 0x7b, 0x81, 0x68, 0x37, 0x0e, 0x63, 0xf1, 0x25,
|
||||
0x77, 0xd5, 0x67, 0xac, 0xc5, 0xcb, 0x0d, 0x70, 0x7c, 0x90, 0x26, 0x64, 0xcd, 0x38, 0x7a, 0x80,
|
||||
0xa3, 0xae, 0x06, 0xd2, 0xc8, 0x20, 0x69, 0xc8, 0x5a, 0xdc, 0x72, 0xc6, 0x68, 0xe0, 0x63, 0x74,
|
||||
0x27, 0x57, 0xa9, 0x29, 0x11, 0x33, 0x8f, 0xbf, 0xe4, 0xa6, 0x4b, 0x1c, 0x0c, 0x36, 0xd2, 0x84,
|
||||
0x3c, 0x28, 0x30, 0x90, 0x06, 0x0c, 0x43, 0x69, 0xfa, 0x32, 0x5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0x4c, 0xe5, 0x22, 0xa8, 0x94, 0xd3, 0x84,
|
||||
0xdc, 0x1a, 0x58, 0x98, 0x5d, 0x85, 0x01, 0x34, 0xfe, 0x05, 0x5a, 0xea, 0x2b, 0xe6, 0x2b, 0xb2,
|
||||
0x7c, 0x69, 0x6d, 0x66, 0x63, 0x26, 0x3f, 0xf5, 0x73, 0x71, 0x06, 0x34, 0xa5, 0x3e, 0xf4, 0x8a,
|
||||
0x45, 0xb0, 0x8f, 0x96, 0x1d, 0xa6, 0xf8, 0x81, 0xdf, 0xf2, 0x55, 0x36, 0x02, 0xf2, 0x90, 0xc7,
|
||||
0x35, 0xee, 0x8a, 0xb0, 0x01, 0x5b, 0xfb, 0x4c, 0xf5, 0x51, 0x9a, 0x90, 0x87, 0xd9, 0xa8, 0x31,
|
||||
0xc5, 0x69, 0xa0, 0xc1, 0x34, 0x1b, 0x40, 0xa9, 0x77, 0x53, 0x2a, 0x01, 0x6f, 0x39, 0x13, 0xc4,
|
||||
0xf4, 0x79, 0x5f, 0x63, 0x2d, 0x98, 0xf0, 0x7a, 0xb7, 0x9e, 0xcd, 0x9f, 0xf7, 0x92, 0xb5, 0x60,
|
||||
0x11, 0x59, 0x4e, 0x17, 0x83, 0xbf, 0x87, 0xae, 0xbc, 0xe4, 0x9d, 0x9a, 0x7f, 0xc6, 0xab, 0x1d,
|
||||
0xc5, 0x25, 0xec, 0xa8, 0x03, 0x6f, 0x50, 0xaf, 0x39, 0xe9, 0x9f, 0x71, 0x5a, 0xd7, 0x75, 0xcb,
|
||||
0x19, 0x80, 0xe3, 0x3d, 0x74, 0xed, 0x15, 0x0b, 0xda, 0xbc, 0x2f, 0x30, 0x07, 0x02, 0x77, 0xd3,
|
||||
0x84, 0x2c, 0x19, 0x81, 0x53, 0x5d, 0x1f, 0x90, 0x18, 0xa2, 0x60, 0x1b, 0xcd, 0xd5, 0x14, 0x0b,
|
||||
0xb8, 0xc3, 0x59, 0x03, 0x36, 0xb7, 0xd9, 0xea, 0x62, 0x9a, 0x90, 0x85, 0x2c, 0xb4, 0x2e, 0xd1,
|
||||
0x98, 0xb3, 0x86, 0xe5, 0xf4, 0x71, 0x56, 0x72, 0x01, 0xdd, 0x9f, 0x34, 0x91, 0x6b, 0x8a, 0x47,
|
||||
0x12, 0x7f, 0x8e, 0xb0, 0xfe, 0xb1, 0x53, 0x53, 0x2c, 0x56, 0xfb, 0x4c, 0xb1, 0x3a, 0x93, 0x66,
|
||||
0x52, 0xcf, 0x56, 0x49, 0x9a, 0x90, 0xbb, 0x5d, 0x0f, 0x1e, 0xed, 0x50, 0xa9, 0x41, 0xb4, 0x91,
|
||||
0xa1, 0x2c, 0xa7, 0x80, 0x8a, 0x1d, 0x74, 0x53, 0xb7, 0x56, 0x6a, 0x2a, 0xe6, 0x52, 0xf6, 0x14,
|
||||
0x2f, 0x80, 0xe2, 0x5a, 0x9a, 0x90, 0x95, 0xbe, 0x62, 0x85, 0x4a, 0x40, 0xe5, 0x24, 0x8b, 0xc8,
|
||||
0xf8, 0x00, 0x2d, 0xe8, 0x66, 0xbb, 0xa6, 0x44, 0xd4, 0x53, 0x9c, 0x01, 0xc5, 0xd5, 0x34, 0x21,
|
||||
0xcb, 0x7d, 0x45, 0x5b, 0x2f, 0xfb, 0x28, 0xa7, 0x37, 0x4a, 0xc4, 0x3f, 0x44, 0xd7, 0x75, 0xe3,
|
||||
0xee, 0x17, 0x51, 0x20, 0x58, 0xe3, 0x40, 0x78, 0x12, 0x16, 0xc3, 0x6c, 0x7e, 0x49, 0x69, 0xad,
|
||||
0x5d, 0xda, 0x06, 0x04, 0x0d, 0x84, 0x27, 0x2d, 0x67, 0x98, 0x64, 0xfd, 0x6b, 0x01, 0x91, 0x82,
|
||||
0x01, 0x7e, 0xee, 0xf1, 0x50, 0xed, 0x89, 0x50, 0xc5, 0x02, 0x2e, 0xa5, 0x5d, 0xdf, 0x17, 0xfb,
|
||||
0xa3, 0x97, 0xd2, 0x6e, 0x4e, 0xea, 0x37, 0x2c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x37, 0x14, 0x2f, 0x00, 0xe9,
|
||||
0x66, 0x12, 0x93, 0xeb, 0x86, 0xe4, 0x0b, 0x97, 0x6a, 0xa2, 0x65, 0xf7, 0x30, 0x98, 0xa2, 0x15,
|
||||
0x63, 0x5f, 0xef, 0x4a, 0xc5, 0xdb, 0x9f, 0x72, 0x15, 0x79, 0x8e, 0x04, 0xfa, 0x1c, 0xd0, 0x1f,
|
||||
0x26, 0x31, 0xb9, 0x6f, 0xe8, 0xe9, 0x6b, 0x91, 0x80, 0xa4, 0x6d, 0x03, 0x4d, 0x05, 0x27, 0xa9,
|
||||
0xe0, 0xdf, 0x16, 0xd0, 0x66, 0x4e, 0xed, 0x45, 0xa0, 0x87, 0x45, 0xf8, 0x4c, 0xf1, 0x26, 0xb8,
|
||||
0x5d, 0x04, 0xb7, 0x52, 0x12, 0x93, 0xed, 0x69, 0x6e, 0x5e, 0x86, 0x97, 0x5a, 0xcf, 0x22, 0x8f,
|
||||
0xff, 0x50, 0x40, 0x0f, 0x0d, 0xee, 0x90, 0x29, 0x1e, 0x38, 0xdd, 0xa3, 0x56, 0x24, 0x3a, 0x6e,
|
||||
0x2b, 0xec, 0xa8, 0x23, 0xaf, 0xcd, 0x25, 0x8f, 0x3c, 0x6e, 0xba, 0x7d, 0x09, 0x82, 0x54, 0x92,
|
||||
0x98, 0xec, 0x0e, 0x05, 0xf1, 0x0d, 0x8f, 0xaa, 0x3e, 0x91, 0xaa, 0x3e, 0x33, 0x8d, 0x32, 0x9b,
|
||||
0x05, 0xfe, 0x0d, 0xda, 0x18, 0x02, 0x1e, 0x78, 0x52, 0x45, 0x5e, 0xa3, 0xa3, 0x3c, 0x11, 0x3c,
|
||||
0xf7, 0x7d, 0x88, 0xf1, 0x3e, 0xc4, 0xd8, 0x49, 0x62, 0xf2, 0x61, 0x6e, 0x8c, 0x66, 0x86, 0x43,
|
||||
0x99, 0xef, 0xa7, 0x09, 0xce, 0x15, 0xc6, 0x5f, 0x15, 0xd0, 0x07, 0x13, 0x41, 0x35, 0x1e, 0x39,
|
||||
0x3c, 0x50, 0x9e, 0xcf, 0x21, 0xc4, 0x65, 0x08, 0xf1, 0x51, 0x12, 0x93, 0xd2, 0xf9, 0x21, 0xc2,
|
||||
0x3e, 0x37, 0xcd, 0x32, 0xab, 0x0d, 0xfe, 0x5d, 0x01, 0x3d, 0x98, 0x88, 0xad, 0x77, 0xda, 0x6d,
|
||||
0x16, 0x75, 0x21, 0xcf, 0x3c, 0xe4, 0x29, 0x27, 0x31, 0xd9, 0x39, 0x3f, 0x8f, 0x34, 0xc4, 0x34,
|
||||
0xcc, 0x4c, 0x06, 0x38, 0x44, 0x6b, 0x43, 0xb8, 0x6a, 0xf7, 0x25, 0xef, 0x7e, 0xd6, 0x69, 0x37,
|
||||
0x78, 0x04, 0x01, 0x16, 0x20, 0xc0, 0xb7, 0x93, 0x98, 0x6c, 0xe5, 0x06, 0x68, 0x74, 0xe9, 0x09,
|
||||
0xef, 0xd2, 0x00, 0x18, 0xa9, 0xf3, 0x54, 0x45, 0xdc, 0x45, 0xa4, 0xce, 0xa3, 0x53, 0x1e, 0x1d,
|
||||
0x78, 0xf2, 0xa4, 0x1e, 0x32, 0x87, 0x7f, 0x21, 0x99, 0xcb, 0xb3, 0xbd, 0x46, 0xa3, 0x53, 0x41,
|
||||
0x02, 0x41, 0xf7, 0xf6, 0x84, 0x4a, 0x4d, 0xa1, 0x1d, 0xcd, 0x19, 0xe9, 0xf1, 0x79, 0xba, 0xf8,
|
||||
0xe7, 0xe8, 0xf6, 0x8f, 0x84, 0x70, 0x7d, 0xbe, 0xef, 0x8b, 0x4e, 0xb3, 0x16, 0x89, 0x2f, 0xb9,
|
||||
0xa3, 0x3e, 0x63, 0x6d, 0x5e, 0x6c, 0x82, 0xe3, 0x83, 0x24, 0x26, 0x1b, 0xc6, 0xd1, 0x05, 0x1c,
|
||||
0x75, 0x34, 0x90, 0x86, 0x06, 0x49, 0x03, 0xd6, 0xe6, 0x96, 0x3d, 0x41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, 0xf8, 0x40, 0x60, 0x01, 0x04, 0xee, 0x26, 0x31,
|
||||
0x59, 0x31, 0x02, 0xa7, 0xba, 0x3e, 0x24, 0x31, 0x42, 0xc1, 0x65, 0xb4, 0x50, 0x57, 0xcc, 0xe7,
|
||||
0x36, 0x67, 0x4d, 0xd8, 0xdc, 0xe6, 0xab, 0xcb, 0x49, 0x4c, 0x96, 0xd2, 0xd0, 0xba, 0x44, 0x23,
|
||||
0xce, 0x9a, 0x96, 0x3d, 0xc0, 0x59, 0xf1, 0x05, 0x74, 0x7f, 0xda, 0x44, 0xae, 0x2b, 0x1e, 0x4a,
|
||||
0xfc, 0x39, 0xc2, 0xfa, 0xc7, 0x5e, 0x5d, 0xb1, 0x48, 0x1d, 0x30, 0xc5, 0x1a, 0x4c, 0x9a, 0x49,
|
||||
0x3d, 0x5f, 0x25, 0x49, 0x4c, 0xee, 0xf6, 0x3c, 0x78, 0xb8, 0x47, 0xa5, 0x06, 0xd1, 0x66, 0x8a,
|
||||
0xb2, 0xec, 0x1c, 0x2a, 0xb6, 0xd1, 0x4d, 0xdd, 0x5a, 0xaa, 0xab, 0x88, 0x4b, 0xd9, 0x57, 0xbc,
|
||||
0x00, 0x8a, 0x1b, 0x49, 0x4c, 0xd6, 0x06, 0x8a, 0x25, 0x2a, 0x01, 0x95, 0x91, 0xcc, 0x23, 0xe3,
|
||||
0x43, 0xb4, 0xa4, 0x9b, 0xcb, 0x75, 0x25, 0xc2, 0xbe, 0xe2, 0x1c, 0x28, 0xae, 0x27, 0x31, 0x59,
|
||||
0x1d, 0x28, 0x96, 0xf5, 0xb2, 0x0f, 0x33, 0x7a, 0xe3, 0x44, 0xfc, 0x43, 0x74, 0x5d, 0x37, 0x56,
|
||||
0xbe, 0x08, 0x7d, 0xc1, 0x9a, 0x87, 0xc2, 0x95, 0xb0, 0x18, 0xe6, 0xb3, 0x4b, 0x4a, 0x6b, 0x55,
|
||||
0x68, 0x07, 0x10, 0xd4, 0x17, 0xae, 0xb4, 0xec, 0x51, 0x92, 0xf5, 0xaf, 0x25, 0x44, 0x72, 0x06,
|
||||
0xf8, 0xb9, 0xcb, 0x03, 0xb5, 0x2f, 0x02, 0x15, 0x09, 0xb8, 0x94, 0xf6, 0x7c, 0x5f, 0x1c, 0x8c,
|
||||
0x5f, 0x4a, 0x7b, 0x39, 0xa9, 0xd7, 0xb4, 0xec, 0x0c, 0x12, 0xff, 0x04, 0xdd, 0xec, 0x3d, 0x1d,
|
||||
0x70, 0xe9, 0x44, 0x1e, 0xec, 0x3a, 0xe9, 0x05, 0x35, 0xf3, 0x5e, 0xfa, 0x02, 0xcd, 0x01, 0xca,
|
||||
0xb2, 0xf3, 0xb8, 0xf8, 0x19, 0x5a, 0xec, 0x35, 0x1f, 0x31, 0x37, 0xbd, 0xac, 0xae, 0x24, 0x31,
|
||||
0xb9, 0x39, 0x22, 0xa5, 0x98, 0x6b, 0xd9, 0x59, 0xac, 0x5e, 0x32, 0x35, 0xce, 0xa3, 0x17, 0x35,
|
||||
0x3d, 0x52, 0x73, 0xc3, 0x57, 0xe4, 0x90, 0xf3, 0x88, 0x7a, 0xa1, 0xb4, 0xec, 0x1e, 0x06, 0xff,
|
||||
0x00, 0x5d, 0x4d, 0x7f, 0xd6, 0x55, 0xe4, 0x05, 0x6e, 0x7a, 0x43, 0x5c, 0x4d, 0x62, 0x72, 0x7b,
|
||||
0x98, 0xa4, 0xdf, 0xbf, 0x17, 0xb8, 0x96, 0x3d, 0x4c, 0xc0, 0x35, 0x84, 0x61, 0x18, 0x6b, 0x22,
|
||||
0x52, 0x47, 0x22, 0xdd, 0x34, 0xd2, 0x6d, 0x20, 0x33, 0x87, 0x98, 0xc6, 0xd0, 0x50, 0x44, 0x8a,
|
||||
0x2a, 0x41, 0xd3, 0x7d, 0xc7, 0xb2, 0x73, 0xb8, 0xb8, 0x8a, 0xae, 0x41, 0xeb, 0x27, 0x41, 0x33,
|
||||
0x14, 0x5e, 0xa0, 0x64, 0xf1, 0x32, 0xf4,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 0xfe, 0x25, 0x5a, 0x4a, 0x25, 0xcc, 0xcc, 0x87, 0x77, 0xf8, 0xd5, 0x1c, 0x18, 0xdd,
|
||||
0xcb, 0x31, 0x1a, 0xa0, 0xb2, 0x07, 0x5c, 0xa6, 0xd9, 0xb2, 0xaf, 0x82, 0x85, 0x6e, 0x81, 0xb7,
|
||||
0xd4, 0x77, 0x38, 0xcb, 0x38, 0xfc, 0x7f, 0xa2, 0xc3, 0x59, 0xbe, 0xc3, 0xd9, 0x98, 0xc3, 0xeb,
|
||||
0xbe, 0xc3, 0x9f, 0x0a, 0x33, 0xdd, 0xe5, 0x8b, 0xff, 0xbd, 0x0c, 0xa6, 0x3b, 0x59, 0xd3, 0x19,
|
||||
0x78, 0xd9, 0x45, 0xdb, 0xe8, 0xd5, 0xa8, 0x30, 0x45, 0xcb, 0x9e, 0xe9, 0x33, 0xe2, 0xeb, 0xc2,
|
||||
0x0c, 0xb7, 0xb4, 0xe2, 0xff, 0x4c, 0xc0, 0xc7, 0xb3, 0x06, 0x04, 0x56, 0xf6, 0x6c, 0x1b, 0xc4,
|
||||
0xd3, 0x37, 0x1b, 0x69, 0xd9, 0xe7, 0x9b, 0x56, 0x6f, 0xbd, 0xf9, 0xcf, 0xfa, 0x7b, 0x6f, 0xde,
|
||||
0xae, 0x17, 0xfe, 0xf9, 0x76, 0xbd, 0xf0, 0xef, 0xb7, 0xeb, 0x85, 0xaf, 0xdf, 0xad, 0xbf, 0xd7,
|
||||
0x78, 0x1f, 0xfe, 0x8c, 0x2b, 0x7f, 0x13, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xbd, 0x27, 0x38, 0x86,
|
||||
0x14, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ message ConfigClientMachineAgentControl {
|
|||
|
||||
flag__consul__v0_7_5 flag__consul__v0_7_5 = 300 [(gogoproto.moretags) = "yaml:\"consul__v0_7_5\""];
|
||||
flag__consul__v0_8_0 flag__consul__v0_8_0 = 301 [(gogoproto.moretags) = "yaml:\"consul__v0_8_0\""];
|
||||
flag__consul__v0_8_3 flag__consul__v0_8_3 = 302 [(gogoproto.moretags) = "yaml:\"consul__v0_8_3\""];
|
||||
flag__consul__v0_8_4 flag__consul__v0_8_4 = 302 [(gogoproto.moretags) = "yaml:\"consul__v0_8_4\""];
|
||||
|
||||
flag__cetcd__beta flag__cetcd__beta = 400 [(gogoproto.moretags) = "yaml:\"cetcd__beta\""];
|
||||
flag__zetcd__beta flag__zetcd__beta = 500 [(gogoproto.moretags) = "yaml:\"zetcd__beta\""];
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const (
|
|||
DatabaseID_zookeeper__r3_5_3_beta DatabaseID = 12
|
||||
DatabaseID_consul__v0_7_5 DatabaseID = 20
|
||||
DatabaseID_consul__v0_8_0 DatabaseID = 21
|
||||
DatabaseID_consul__v0_8_3 DatabaseID = 22
|
||||
DatabaseID_consul__v0_8_4 DatabaseID = 22
|
||||
DatabaseID_zetcd__beta DatabaseID = 30
|
||||
DatabaseID_cetcd__beta DatabaseID = 40
|
||||
)
|
||||
|
|
@ -43,7 +43,7 @@ var DatabaseID_name = map[int32]string{
|
|||
12: "zookeeper__r3_5_3_beta",
|
||||
20: "consul__v0_7_5",
|
||||
21: "consul__v0_8_0",
|
||||
22: "consul__v0_8_3",
|
||||
22: "consul__v0_8_4",
|
||||
30: "zetcd__beta",
|
||||
40: "cetcd__beta",
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ var DatabaseID_value = map[string]int32{
|
|||
"zookeeper__r3_5_3_beta": 12,
|
||||
"consul__v0_7_5": 20,
|
||||
"consul__v0_8_0": 21,
|
||||
"consul__v0_8_3": 22,
|
||||
"consul__v0_8_4": 22,
|
||||
"zetcd__beta": 30,
|
||||
"cetcd__beta": 40,
|
||||
}
|
||||
|
|
@ -74,22 +74,22 @@ func init() {
|
|||
func init() { proto.RegisterFile("dbtesterpb/database_id.proto", fileDescriptorDatabaseId) }
|
||||
|
||||
var fileDescriptorDatabaseId = []byte{
|
||||
// 261 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xc1, 0x4a, 0x03, 0x31,
|
||||
0x10, 0x86, 0x37, 0x0a, 0x82, 0x53, 0xad, 0x63, 0x68, 0x2b, 0x54, 0xc9, 0x59, 0x04, 0xbb, 0x75,
|
||||
0x63, 0x51, 0xaf, 0xd2, 0x8b, 0x4f, 0x31, 0x24, 0xbb, 0x71, 0xbb, 0x58, 0x4d, 0xd8, 0xcd, 0xf6,
|
||||
0xd0, 0x27, 0xf1, 0x91, 0x7a, 0xf4, 0x11, 0x74, 0x7d, 0x0a, 0x6f, 0x62, 0x56, 0xb0, 0xad, 0xb7,
|
||||
0x7c, 0xdf, 0x9f, 0xf9, 0x19, 0x06, 0xce, 0x32, 0xed, 0x4d, 0xe5, 0x4d, 0xe9, 0x74, 0x9c, 0x29,
|
||||
0xaf, 0xb4, 0xaa, 0x0c, 0x15, 0xd9, 0xc8, 0x95, 0xd6, 0x5b, 0x0e, 0x7f, 0xe9, 0xf0, 0x32, 0x2f,
|
||||
0xfc, 0xac, 0xd6, 0xa3, 0xd4, 0x3e, 0xc7, 0xb9, 0xcd, 0x6d, 0x1c, 0xbe, 0xe8, 0xfa, 0x31, 0x50,
|
||||
0x80, 0xf0, 0x6a, 0x47, 0x2f, 0xbe, 0x18, 0xc0, 0xf4, 0xb7, 0xf0, 0x61, 0xca, 0xbb, 0x00, 0xc6,
|
||||
0xa7, 0x19, 0xd1, 0x22, 0x21, 0x89, 0xd1, 0x1a, 0x4b, 0xba, 0x42, 0xb6, 0xc1, 0x09, 0xee, 0xf0,
|
||||
0x43, 0xd8, 0x6f, 0xd9, 0x17, 0x0e, 0x77, 0x79, 0x1f, 0x8e, 0x97, 0xd6, 0x3e, 0x19, 0xe3, 0x4c,
|
||||
0x49, 0x54, 0x4a, 0xba, 0xa6, 0x3b, 0x04, 0x7e, 0x0a, 0x27, 0x9b, 0x7a, 0x42, 0x09, 0xa9, 0xb9,
|
||||
0x9b, 0x29, 0xec, 0xf0, 0x21, 0x0c, 0xb6, 0x43, 0x49, 0xda, 0x78, 0x85, 0x07, 0x9c, 0x43, 0x37,
|
||||
0xb5, 0x2f, 0x55, 0x3d, 0x27, 0x5a, 0x8c, 0xe9, 0x86, 0x26, 0xd8, 0xdb, 0x72, 0xb7, 0x34, 0xc6,
|
||||
0xfe, 0x3f, 0x27, 0x71, 0xc0, 0x8f, 0xa0, 0xb3, 0x6c, 0x77, 0x0b, 0x65, 0xe2, 0x47, 0xa4, 0x6b,
|
||||
0xe2, 0xfc, 0xbe, 0xb7, 0xfa, 0x10, 0xd1, 0xaa, 0x11, 0xec, 0xad, 0x11, 0xec, 0xbd, 0x11, 0xec,
|
||||
0xf5, 0x53, 0x44, 0x7a, 0x2f, 0x1c, 0x46, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xf2, 0x67,
|
||||
0x53, 0x73, 0x01, 0x00, 0x00,
|
||||
// 263 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4e, 0xeb, 0x30,
|
||||
0x10, 0x86, 0xe3, 0xf7, 0x24, 0x24, 0xa6, 0x50, 0x06, 0xab, 0x2d, 0x52, 0x41, 0x5e, 0x23, 0x24,
|
||||
0x9a, 0x12, 0xb7, 0x02, 0xb6, 0xa8, 0x1b, 0x4e, 0x31, 0xb2, 0x13, 0x93, 0x46, 0x14, 0x6c, 0x25,
|
||||
0x4e, 0x17, 0x3d, 0x09, 0x47, 0xea, 0x92, 0x23, 0x40, 0x38, 0x05, 0x3b, 0x84, 0x83, 0x44, 0x5b,
|
||||
0x76, 0xfe, 0xbe, 0xdf, 0xf3, 0x6b, 0x34, 0x70, 0x96, 0x69, 0x6f, 0x2a, 0x6f, 0x4a, 0xa7, 0xe3,
|
||||
0x4c, 0x79, 0xa5, 0x55, 0x65, 0xa8, 0xc8, 0x46, 0xae, 0xb4, 0xde, 0x72, 0xf8, 0x4d, 0x87, 0x97,
|
||||
0x79, 0xe1, 0xe7, 0xb5, 0x1e, 0xa5, 0xf6, 0x29, 0xce, 0x6d, 0x6e, 0xe3, 0xf0, 0x45, 0xd7, 0x0f,
|
||||
0x81, 0x02, 0x84, 0x57, 0x3b, 0x7a, 0xf1, 0xc9, 0x00, 0x66, 0x3f, 0x85, 0xf7, 0x33, 0xde, 0x05,
|
||||
0x30, 0x3e, 0xcd, 0x88, 0x96, 0x09, 0x49, 0x8c, 0x36, 0x58, 0xd2, 0x15, 0xb2, 0x2d, 0x4e, 0xf0,
|
||||
0x1f, 0x3f, 0x84, 0xfd, 0x96, 0x7d, 0xe1, 0xf0, 0x3f, 0xef, 0xc3, 0xf1, 0xca, 0xda, 0x47, 0x63,
|
||||
0x9c, 0x29, 0x89, 0x4a, 0x49, 0x13, 0xba, 0x45, 0xe0, 0xa7, 0x70, 0xb2, 0xad, 0xa7, 0x94, 0x90,
|
||||
0x5a, 0xb8, 0xb9, 0xc2, 0x0e, 0x1f, 0xc2, 0x60, 0x37, 0x94, 0xa4, 0x8d, 0x57, 0x78, 0xc0, 0x39,
|
||||
0x74, 0x53, 0xfb, 0x5c, 0xd5, 0x0b, 0xa2, 0xe5, 0x98, 0xae, 0x69, 0x8a, 0xbd, 0x1d, 0x77, 0x43,
|
||||
0x63, 0xec, 0xff, 0x71, 0x13, 0x1c, 0xf0, 0x23, 0xe8, 0xac, 0xda, 0xdd, 0x42, 0x99, 0xf8, 0x16,
|
||||
0xe9, 0x86, 0x38, 0xbf, 0xeb, 0xad, 0xdf, 0x45, 0xb4, 0x6e, 0x04, 0x7b, 0x6d, 0x04, 0x7b, 0x6b,
|
||||
0x04, 0x7b, 0xf9, 0x10, 0x91, 0xde, 0x0b, 0x87, 0x91, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x27,
|
||||
0x43, 0x40, 0x47, 0x73, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ enum DatabaseID {
|
|||
|
||||
consul__v0_7_5 = 20;
|
||||
consul__v0_8_0 = 21;
|
||||
consul__v0_8_3 = 22;
|
||||
consul__v0_8_4 = 22;
|
||||
|
||||
zetcd__beta = 30;
|
||||
cetcd__beta = 40;
|
||||
|
|
|
|||
|
|
@ -34,18 +34,18 @@ func (*Flag_Consul_V0_8_0) ProtoMessage() {}
|
|||
func (*Flag_Consul_V0_8_0) Descriptor() ([]byte, []int) { return fileDescriptorFlagConsul, []int{1} }
|
||||
|
||||
// See https://github.com/hashicorp/consul for more.
|
||||
type Flag_Consul_V0_8_3 struct {
|
||||
type Flag_Consul_V0_8_4 struct {
|
||||
}
|
||||
|
||||
func (m *Flag_Consul_V0_8_3) Reset() { *m = Flag_Consul_V0_8_3{} }
|
||||
func (m *Flag_Consul_V0_8_3) String() string { return proto.CompactTextString(m) }
|
||||
func (*Flag_Consul_V0_8_3) ProtoMessage() {}
|
||||
func (*Flag_Consul_V0_8_3) Descriptor() ([]byte, []int) { return fileDescriptorFlagConsul, []int{2} }
|
||||
func (m *Flag_Consul_V0_8_4) Reset() { *m = Flag_Consul_V0_8_4{} }
|
||||
func (m *Flag_Consul_V0_8_4) String() string { return proto.CompactTextString(m) }
|
||||
func (*Flag_Consul_V0_8_4) ProtoMessage() {}
|
||||
func (*Flag_Consul_V0_8_4) Descriptor() ([]byte, []int) { return fileDescriptorFlagConsul, []int{2} }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Flag_Consul_V0_7_5)(nil), "dbtesterpb.flag__consul__v0_7_5")
|
||||
proto.RegisterType((*Flag_Consul_V0_8_0)(nil), "dbtesterpb.flag__consul__v0_8_0")
|
||||
proto.RegisterType((*Flag_Consul_V0_8_3)(nil), "dbtesterpb.flag__consul__v0_8_3")
|
||||
proto.RegisterType((*Flag_Consul_V0_8_4)(nil), "dbtesterpb.flag__consul__v0_8_4")
|
||||
}
|
||||
func (m *Flag_Consul_V0_7_5) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
|
|
@ -83,7 +83,7 @@ func (m *Flag_Consul_V0_8_0) MarshalTo(dAtA []byte) (int, error) {
|
|||
return i, nil
|
||||
}
|
||||
|
||||
func (m *Flag_Consul_V0_8_3) Marshal() (dAtA []byte, err error) {
|
||||
func (m *Flag_Consul_V0_8_4) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalTo(dAtA)
|
||||
|
|
@ -93,7 +93,7 @@ func (m *Flag_Consul_V0_8_3) Marshal() (dAtA []byte, err error) {
|
|||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Flag_Consul_V0_8_3) MarshalTo(dAtA []byte) (int, error) {
|
||||
func (m *Flag_Consul_V0_8_4) MarshalTo(dAtA []byte) (int, error) {
|
||||
var i int
|
||||
_ = i
|
||||
var l int
|
||||
|
|
@ -140,7 +140,7 @@ func (m *Flag_Consul_V0_8_0) Size() (n int) {
|
|||
return n
|
||||
}
|
||||
|
||||
func (m *Flag_Consul_V0_8_3) Size() (n int) {
|
||||
func (m *Flag_Consul_V0_8_4) Size() (n int) {
|
||||
var l int
|
||||
_ = l
|
||||
return n
|
||||
|
|
@ -259,7 +259,7 @@ func (m *Flag_Consul_V0_8_0) Unmarshal(dAtA []byte) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Flag_Consul_V0_8_3) Unmarshal(dAtA []byte) error {
|
||||
func (m *Flag_Consul_V0_8_4) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
|
|
@ -282,10 +282,10 @@ func (m *Flag_Consul_V0_8_3) Unmarshal(dAtA []byte) error {
|
|||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: flag__consul__v0_8_3: wiretype end group for non-group")
|
||||
return fmt.Errorf("proto: flag__consul__v0_8_4: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: flag__consul__v0_8_3: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
return fmt.Errorf("proto: flag__consul__v0_8_4: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
default:
|
||||
|
|
@ -424,7 +424,7 @@ var fileDescriptorFlagConsul = []byte{
|
|||
0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb, 0x83, 0x95,
|
||||
0x24, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0xd1, 0xaa, 0x24, 0xc6, 0x25, 0x02, 0x36,
|
||||
0x0f, 0x6a, 0x60, 0x7c, 0x7c, 0x99, 0x41, 0xbc, 0x79, 0xbc, 0x29, 0x56, 0x71, 0x8b, 0x78, 0x03,
|
||||
0x1c, 0xe2, 0xc6, 0x4e, 0x22, 0x27, 0x1e, 0xca, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91,
|
||||
0x1c, 0xe2, 0x26, 0x4e, 0x22, 0x27, 0x1e, 0xca, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91,
|
||||
0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0x2d, 0x31, 0x06,
|
||||
0x04, 0x00, 0x00, 0xff, 0xff, 0x06, 0x4b, 0x2e, 0x7f, 0xbf, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0xff, 0xff, 0x31, 0xd1, 0x99, 0x57, 0xbf, 0x00, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ message flag__consul__v0_8_0 {
|
|||
}
|
||||
|
||||
// See https://github.com/hashicorp/consul for more.
|
||||
message flag__consul__v0_8_3 {
|
||||
message flag__consul__v0_8_4 {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ type Request struct {
|
|||
Flag_Zookeeper_R3_5_3Beta *Flag_Zookeeper_R3_5_3Beta `protobuf:"bytes,202,opt,name=flag__zookeeper__r3_5_3_beta,json=flagZookeeperR353Beta" json:"flag__zookeeper__r3_5_3_beta,omitempty"`
|
||||
Flag_Consul_V0_7_5 *Flag_Consul_V0_7_5 `protobuf:"bytes,300,opt,name=flag__consul__v0_7_5,json=flagConsulV075" json:"flag__consul__v0_7_5,omitempty"`
|
||||
Flag_Consul_V0_8_0 *Flag_Consul_V0_8_0 `protobuf:"bytes,301,opt,name=flag__consul__v0_8_0,json=flagConsulV080" json:"flag__consul__v0_8_0,omitempty"`
|
||||
Flag_Consul_V0_8_3 *Flag_Consul_V0_8_3 `protobuf:"bytes,302,opt,name=flag__consul__v0_8_3,json=flagConsulV083" json:"flag__consul__v0_8_3,omitempty"`
|
||||
Flag_Consul_V0_8_4 *Flag_Consul_V0_8_4 `protobuf:"bytes,302,opt,name=flag__consul__v0_8_4,json=flagConsulV084" json:"flag__consul__v0_8_4,omitempty"`
|
||||
Flag_Cetcd_Beta *Flag_Cetcd_Beta `protobuf:"bytes,400,opt,name=flag__cetcd__beta,json=flagCetcdBeta" json:"flag__cetcd__beta,omitempty"`
|
||||
Flag_Zetcd_Beta *Flag_Zetcd_Beta `protobuf:"bytes,500,opt,name=flag__zetcd__beta,json=flagZetcdBeta" json:"flag__zetcd__beta,omitempty"`
|
||||
}
|
||||
|
|
@ -340,13 +340,13 @@ func (m *Request) MarshalTo(dAtA []byte) (int, error) {
|
|||
}
|
||||
i += n10
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 != nil {
|
||||
if m.Flag_Consul_V0_8_4 != nil {
|
||||
dAtA[i] = 0xf2
|
||||
i++
|
||||
dAtA[i] = 0x12
|
||||
i++
|
||||
i = encodeVarintMessage(dAtA, i, uint64(m.Flag_Consul_V0_8_3.Size()))
|
||||
n11, err := m.Flag_Consul_V0_8_3.MarshalTo(dAtA[i:])
|
||||
i = encodeVarintMessage(dAtA, i, uint64(m.Flag_Consul_V0_8_4.Size()))
|
||||
n11, err := m.Flag_Consul_V0_8_4.MarshalTo(dAtA[i:])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
@ -505,8 +505,8 @@ func (m *Request) Size() (n int) {
|
|||
l = m.Flag_Consul_V0_8_0.Size()
|
||||
n += 2 + l + sovMessage(uint64(l))
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 != nil {
|
||||
l = m.Flag_Consul_V0_8_3.Size()
|
||||
if m.Flag_Consul_V0_8_4 != nil {
|
||||
l = m.Flag_Consul_V0_8_4.Size()
|
||||
n += 2 + l + sovMessage(uint64(l))
|
||||
}
|
||||
if m.Flag_Cetcd_Beta != nil {
|
||||
|
|
@ -1060,7 +1060,7 @@ func (m *Request) Unmarshal(dAtA []byte) error {
|
|||
iNdEx = postIndex
|
||||
case 302:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Flag_Consul_V0_8_3", wireType)
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Flag_Consul_V0_8_4", wireType)
|
||||
}
|
||||
var msglen int
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
|
|
@ -1084,10 +1084,10 @@ func (m *Request) Unmarshal(dAtA []byte) error {
|
|||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
if m.Flag_Consul_V0_8_3 == nil {
|
||||
m.Flag_Consul_V0_8_3 = &Flag_Consul_V0_8_3{}
|
||||
if m.Flag_Consul_V0_8_4 == nil {
|
||||
m.Flag_Consul_V0_8_4 = &Flag_Consul_V0_8_4{}
|
||||
}
|
||||
if err := m.Flag_Consul_V0_8_3.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
if err := m.Flag_Consul_V0_8_4.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
|
@ -1375,55 +1375,55 @@ var (
|
|||
func init() { proto.RegisterFile("dbtesterpb/message.proto", fileDescriptorMessage) }
|
||||
|
||||
var fileDescriptorMessage = []byte{
|
||||
// 786 bytes of a gzipped FileDescriptorProto
|
||||
// 787 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x95, 0x5f, 0x4e, 0xeb, 0x46,
|
||||
0x14, 0xc6, 0x63, 0x72, 0xef, 0x25, 0x99, 0x28, 0xb7, 0x61, 0xf8, 0xd3, 0x51, 0x80, 0xd4, 0xa2,
|
||||
0x15, 0x4a, 0x91, 0x9a, 0x04, 0x9b, 0x14, 0x78, 0x84, 0xd0, 0x8a, 0x48, 0x6d, 0x41, 0x93, 0x80,
|
||||
0x2a, 0x5e, 0x46, 0x63, 0x67, 0x62, 0x2c, 0x12, 0xdb, 0x1d, 0x4f, 0x50, 0xcb, 0x2a, 0xfa, 0xd8,
|
||||
0x45, 0xb4, 0x5d, 0x07, 0xed, 0x53, 0x97, 0xd0, 0xd2, 0x2e, 0xa1, 0x0b, 0xa8, 0x3c, 0xce, 0x9f,
|
||||
0x49, 0xe2, 0x34, 0xbc, 0x71, 0xbe, 0xef, 0x3b, 0xbf, 0x23, 0x1f, 0x9c, 0x63, 0x80, 0x3a, 0x96,
|
||||
0x60, 0xa1, 0x60, 0x3c, 0xb0, 0xaa, 0x7d, 0x16, 0x86, 0xd4, 0x61, 0x95, 0x80, 0xfb, 0xc2, 0x87,
|
||||
0x60, 0xe2, 0x14, 0x3f, 0x73, 0x5c, 0x71, 0x3f, 0xb0, 0x2a, 0xb6, 0xdf, 0xaf, 0x3a, 0xbe, 0xe3,
|
||||
0x57, 0x65, 0xc4, 0x1a, 0x74, 0x65, 0x25, 0x0b, 0xf9, 0x57, 0xdc, 0x5a, 0xdc, 0x51, 0xa0, 0x1d,
|
||||
0x2a, 0xa8, 0x45, 0x43, 0x46, 0xdc, 0xce, 0xd0, 0x2d, 0x2a, 0x6e, 0xb7, 0x47, 0x1d, 0xc2, 0x84,
|
||||
0x3d, 0xf2, 0x3e, 0x9a, 0xf5, 0x9e, 0x7c, 0xff, 0x81, 0xb1, 0x80, 0xf1, 0x04, 0xb4, 0x0c, 0xd8,
|
||||
0xbe, 0x17, 0x0e, 0x7a, 0x43, 0x77, 0x7b, 0xae, 0x5d, 0x61, 0xcf, 0x99, 0xb6, 0x62, 0xee, 0x2b,
|
||||
0xa6, 0xed, 0x7b, 0x5d, 0xd7, 0x21, 0x76, 0xcf, 0x65, 0x9e, 0x20, 0x7d, 0x6a, 0xdf, 0xbb, 0xde,
|
||||
0x70, 0x2b, 0x7b, 0xff, 0x00, 0xb0, 0x8a, 0xd9, 0x77, 0x03, 0x16, 0x0a, 0x68, 0x82, 0xec, 0x55,
|
||||
0xc0, 0x38, 0x15, 0xae, 0xef, 0x21, 0x4d, 0xd7, 0xca, 0xef, 0x8d, 0xcd, 0xca, 0x84, 0x53, 0x19,
|
||||
0x9b, 0x78, 0x92, 0x83, 0x07, 0xa0, 0xd0, 0xe6, 0xae, 0xe3, 0x30, 0xfe, 0x95, 0xef, 0xdc, 0x04,
|
||||
0x3d, 0x9f, 0x76, 0xd0, 0x8a, 0xae, 0x95, 0x33, 0x78, 0x4e, 0x87, 0x9f, 0x03, 0x70, 0x31, 0x5c,
|
||||
0x5f, 0xf3, 0x02, 0xa5, 0xe5, 0x84, 0x2d, 0x75, 0xc2, 0xc4, 0xc5, 0x4a, 0x12, 0xea, 0x20, 0x37,
|
||||
0xaa, 0xda, 0xd4, 0x41, 0x6f, 0x74, 0xad, 0x9c, 0xc5, 0xaa, 0x04, 0x3f, 0x01, 0xf9, 0x6b, 0xc6,
|
||||
0x78, 0xf3, 0x3a, 0x6c, 0x09, 0xee, 0x7a, 0x0e, 0x7a, 0x2b, 0x33, 0xd3, 0x22, 0x44, 0x60, 0xb5,
|
||||
0x79, 0xdd, 0xf4, 0x3a, 0xec, 0x7b, 0xf4, 0x4e, 0xd7, 0xca, 0x79, 0x3c, 0x2a, 0x61, 0x0d, 0xac,
|
||||
0x37, 0x06, 0x9c, 0x33, 0x4f, 0x34, 0xe4, 0x96, 0xbe, 0x19, 0xf4, 0x2d, 0xc6, 0xd1, 0xaa, 0xae,
|
||||
0x95, 0xd3, 0x38, 0xc9, 0x82, 0x5d, 0x50, 0x6c, 0xc8, 0xbd, 0xc6, 0xea, 0xd7, 0xf1, 0x56, 0x9b,
|
||||
0x9e, 0x2b, 0x5c, 0xda, 0x43, 0x19, 0x5d, 0x2b, 0xe7, 0x8c, 0x7d, 0xf5, 0xd9, 0x16, 0xa7, 0xf1,
|
||||
0xff, 0x90, 0x60, 0x03, 0x14, 0xe4, 0x3f, 0x57, 0xbe, 0x55, 0x84, 0x3c, 0x1a, 0xc4, 0x44, 0x1d,
|
||||
0x49, 0xdf, 0x51, 0xe9, 0xb3, 0x19, 0x9c, 0x8b, 0x94, 0x2f, 0x84, 0xdd, 0xb9, 0x35, 0xcc, 0x39,
|
||||
0x88, 0x49, 0x0e, 0x11, 0x5b, 0x02, 0x31, 0xc9, 0xa1, 0x02, 0x31, 0x0f, 0x13, 0x20, 0x06, 0xea,
|
||||
0x2e, 0x85, 0x18, 0x2a, 0xc4, 0x80, 0x67, 0xe0, 0x03, 0x35, 0x20, 0xdc, 0x00, 0x39, 0x92, 0xb1,
|
||||
0xbd, 0x88, 0x21, 0xdc, 0x60, 0x82, 0x68, 0xbb, 0x01, 0xfc, 0x16, 0x7c, 0x18, 0xfb, 0xe3, 0xdf,
|
||||
0x12, 0x21, 0xdc, 0x24, 0x47, 0xe4, 0x14, 0x3d, 0x6b, 0x92, 0xf5, 0xf1, 0x3c, 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16, 0x86, 0xf2, 0xc8, 0x66,
|
||||
0xf0, 0xa8, 0x8c, 0xae, 0xd0, 0x85, 0x1b, 0x3e, 0xb4, 0x02, 0x6a, 0xb3, 0x9b, 0xe8, 0xd3, 0x75,
|
||||
0xfe, 0x83, 0x60, 0xa1, 0x3c, 0xa7, 0x69, 0x9c, 0x64, 0x1d, 0x54, 0x95, 0x93, 0x0d, 0xb3, 0xe0,
|
||||
0x6d, 0x4b, 0x50, 0x2e, 0x0a, 0x29, 0x98, 0x01, 0x6f, 0x5a, 0xc2, 0x0f, 0x0a, 0x1a, 0xcc, 0x83,
|
||||
0xec, 0x25, 0xa3, 0x5c, 0x58, 0x8c, 0x8a, 0xc2, 0x8a, 0xf1, 0x25, 0xc8, 0xb5, 0x39, 0xf5, 0xc2,
|
||||
0xc0, 0xe7, 0x82, 0x71, 0x78, 0x0c, 0x32, 0xb2, 0xec, 0x32, 0x0e, 0xd7, 0xd5, 0x27, 0x1a, 0x7e,
|
||||
0x13, 0x8a, 0x1b, 0xd3, 0x62, 0xfc, 0x08, 0x7b, 0xa9, 0xf3, 0x8d, 0xe7, 0xbf, 0x4a, 0xa9, 0xe7,
|
||||
0x97, 0x92, 0xf6, 0xc7, 0x4b, 0x49, 0xfb, 0xf3, 0xa5, 0xa4, 0xfd, 0xf4, 0x77, 0x29, 0x65, 0xbd,
|
||||
0x93, 0x1f, 0x15, 0xf3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xdf, 0x47, 0xa0, 0x86, 0x07,
|
||||
0x00, 0x00,
|
||||
0x14, 0xc6, 0x63, 0x72, 0xef, 0x25, 0x99, 0x28, 0xb7, 0xb9, 0x73, 0x81, 0x8e, 0x02, 0xa4, 0x16,
|
||||
0xad, 0x50, 0x8a, 0xd4, 0x24, 0xd8, 0x49, 0x81, 0x47, 0x08, 0xad, 0x88, 0xd4, 0x16, 0x34, 0x09,
|
||||
0xa8, 0xe2, 0x65, 0x34, 0x76, 0x26, 0xc6, 0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 0x2a, 0x7d, 0x3e, 0x83, 0x73, 0x91, 0xf2, 0x85, 0xb0, 0xbb, 0x37, 0x86, 0xb9,
|
||||
0x00, 0x31, 0xc9, 0x21, 0x62, 0x2b, 0x20, 0x26, 0x39, 0x54, 0x20, 0xe6, 0x61, 0x02, 0xc4, 0x40,
|
||||
0xbd, 0x95, 0x10, 0x43, 0x85, 0x18, 0xf0, 0x14, 0x7c, 0xa0, 0x06, 0x84, 0x1b, 0x20, 0x47, 0x32,
|
||||
0xb6, 0x97, 0x31, 0x84, 0x1b, 0x4c, 0x11, 0x1d, 0x37, 0x80, 0xdf, 0x82, 0x0f, 0x63, 0x7f, 0xf2,
|
||||
0x5b, 0x22, 0x84, 0x9b, 0xa4, 0x4e, 0x4e, 0xd0, 0x93, 0x26, 0x59, 0x1f, 0x2f, 0xb2, 0x16, 0xb2,
|
||||
0xf8, 0x5d, 0x64, 0xdc, 0x8e, 0x65, 0x6c, 0xd6, 0x4f, 0xa0, 0x0b, 0x76, 0x93, 0xd2, 0x0d, 0x62,
|
||||
0x10, 0xda, 0x0f, 0xee, 0x28, 0xfa, 0x2d, 0xe6, 0x7f, 0xba, 0x8a, 0x3f, 0xe9, 0xc0, 0x5b, 0x73,
|
||||
0x53, 0x1a, 0xc6, 0x69, 0xa4, 0xc3, 0x1e, 0xd8, 0x49, 0x6e, 0x34, 0x89, 0xc5, 0x04, 0x45, 0xbf,
|
||||
0xc7, 0x93, 0xca, 0xab, 0x27, 0xc5, 0x0d, 0x78, 0x73, 0x7e, 0x90, 0x79, 0xc6, 0x04, 0x85, 0x97,
|
||||
0x60, 0x23, 0x6e, 0x8b, 0xef, 0x0a, 0x21, 0x0f, 0x35, 0x72, 0x44, 0x1a, 0xe8, 0xe7, 0x35, 0xc9,
|
||||
0xd7, 0x17, 0xf9, 0xb3, 0x41, 0xfc, 0x36, 0x52, 0x9b, 0x52, 0xbb, 0xa9, 0x1d, 0x35, 0x12, 0x81,
|
||||
0xc7, 0xa4, 0x86, 0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, 0xcf, 0x25, 0xed, 0x8f, 0xe7, 0x92, 0xf6, 0xe7, 0x73, 0x49, 0xfb, 0xe9, 0xef, 0x52, 0xca,
|
||||
0x7a, 0x23, 0x3f, 0x2a, 0xe6, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x57, 0x68, 0x8f, 0x9f, 0x86,
|
||||
0x07, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ message Request {
|
|||
|
||||
flag__consul__v0_7_5 flag__consul__v0_7_5 = 300;
|
||||
flag__consul__v0_8_0 flag__consul__v0_8_0 = 301;
|
||||
flag__consul__v0_8_3 flag__consul__v0_8_3 = 302;
|
||||
flag__consul__v0_8_4 flag__consul__v0_8_4 = 302;
|
||||
|
||||
flag__cetcd__beta flag__cetcd__beta = 400;
|
||||
flag__zetcd__beta flag__zetcd__beta = 500;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ func GetRGBI(databaseID string, i int) color.Color {
|
|||
return color.RGBA{198, 53, 53, 255} // red
|
||||
case "consul__v0_8_0":
|
||||
return color.RGBA{212, 88, 102, 255} // red
|
||||
case "consul__v0_8_3":
|
||||
case "consul__v0_8_4":
|
||||
return color.RGBA{254, 25, 102, 255} // red
|
||||
case "zetcd__beta":
|
||||
return color.RGBA{251, 206, 0, 255} // yellow
|
||||
|
|
@ -79,7 +79,7 @@ func GetRGBII(databaseID string, i int) color.Color {
|
|||
return color.RGBA{247, 156, 156, 255} // light-red
|
||||
case "consul__v0_8_0":
|
||||
return color.RGBA{238, 148, 178, 255} // light-red
|
||||
case "consul__v0_8_3":
|
||||
case "consul__v0_8_4":
|
||||
return color.RGBA{255, 202, 178, 255} // light-red
|
||||
case "zetcd__beta":
|
||||
return color.RGBA{245, 247, 166, 255} // light-yellow
|
||||
|
|
@ -105,7 +105,7 @@ func GetRGBIII(databaseID string, i int) color.Color {
|
|||
return color.RGBA{212, 8, 46, 255} // deep-red
|
||||
case "consul__v0_8_0":
|
||||
return color.RGBA{251, 110, 84, 255} // deep-red
|
||||
case "consul__v0_8_3":
|
||||
case "consul__v0_8_4":
|
||||
return color.RGBA{245, 144, 84, 255} // deep-red
|
||||
case "zetcd__beta":
|
||||
return color.RGBA{229, 255, 0, 255} // deep-yellow
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
hash: 5e1d8fbc5be013d480be78b72b4cd9dff05cd113e66e26c9d191645552c9ac01
|
||||
updated: 2017-05-17T10:26:42.08303874-07:00
|
||||
hash: 18200e5c7afdb7086a85d33bc917911a8ea74019d5f4d2aad9cebf0d71a4c23c
|
||||
updated: 2017-06-23T09:01:56.103326562-07:00
|
||||
imports:
|
||||
- name: bitbucket.org/zombiezen/gopdf
|
||||
version: 1c63dc69751bc45441c2ce1f56b631c55294b4d5
|
||||
|
|
@ -13,11 +13,11 @@ imports:
|
|||
- internal/optional
|
||||
- storage
|
||||
- name: github.com/ajstarks/svgo
|
||||
version: 19107c66f5c698e4151e641bc726cadded2f60b5
|
||||
version: fec71ff44529c89ddb4211a62f3d672f31e50bc5
|
||||
- name: github.com/cheggaaa/pb
|
||||
version: d7e6ca3010b6f084d8056847f55d7f572f180678
|
||||
- name: github.com/coreos/etcd
|
||||
version: 1763f7d4d1f865f7650d64a6c29983f7dc2494fb
|
||||
version: 47a8156851b5a59665421661edb7c813f8a7993e
|
||||
subpackages:
|
||||
- auth/authpb
|
||||
- client
|
||||
|
|
@ -35,7 +35,7 @@ imports:
|
|||
- pkg/types
|
||||
- version
|
||||
- name: github.com/coreos/go-semver
|
||||
version: 568e959cd89871e61434c1143528d9162da89ef2
|
||||
version: 8ab6407b697782a06568d4b7f1db25550ec2e4c6
|
||||
subpackages:
|
||||
- semver
|
||||
- name: github.com/coreos/go-systemd
|
||||
|
|
@ -51,13 +51,13 @@ imports:
|
|||
- name: github.com/dustin/go-humanize
|
||||
version: ef638b6c2e62b857442c6443dace9366a48c0ee2
|
||||
- name: github.com/gogo/protobuf
|
||||
version: 8d70fb3182befc465c4a1eac8ad4d38ff49778e2
|
||||
version: 100ba4e885062801d56799d78530b73b178a78f3
|
||||
subpackages:
|
||||
- gogoproto
|
||||
- proto
|
||||
- protoc-gen-gogo/descriptor
|
||||
- name: github.com/golang/freetype
|
||||
version: bcfeb16b74e8aea9e2fe043406f2ef74b1cb0759
|
||||
version: e2365dfdc4a05e4b8299a783240d4a7d5a65d4e4
|
||||
subpackages:
|
||||
- raster
|
||||
- truetype
|
||||
|
|
@ -66,14 +66,15 @@ imports:
|
|||
subpackages:
|
||||
- jsonpb
|
||||
- proto
|
||||
- ptypes/any
|
||||
- name: github.com/gonum/floats
|
||||
version: a2cbc5c70616cd18491ef2843231f6ce28b2cb02
|
||||
- name: github.com/gonum/internal
|
||||
version: abbe1115275b8ef5f1c4b73e2360c9e8177edcb2
|
||||
version: 4c20688f849035792bcee8a94ec93b5c277c919f
|
||||
subpackages:
|
||||
- asm/f64
|
||||
- name: github.com/gonum/plot
|
||||
version: 395bf7867dd5a3c85271e0b53fb222d8516d3750
|
||||
version: 51b62dc5319d7fce41240d13e780a93e640b9a38
|
||||
subpackages:
|
||||
- palette
|
||||
- plotter
|
||||
|
|
@ -87,11 +88,11 @@ imports:
|
|||
- vg/vgpdf
|
||||
- vg/vgsvg
|
||||
- name: github.com/googleapis/gax-go
|
||||
version: 9af46dd5a1713e8b5cd71106287eba3cefdde50b
|
||||
version: 84ed26760e7f6f80887a2fbfb50db3cc415d2cea
|
||||
- name: github.com/gyuho/dataframe
|
||||
version: 73de2c550b1177c1640f3dacbbc1af00f913fedb
|
||||
- name: github.com/gyuho/linux-inspect
|
||||
version: 459d0d77e4e21890fcedaa601a19db7b80653a86
|
||||
version: db8def6abe6a96a20aae6ae01664cc3817a27ba0
|
||||
subpackages:
|
||||
- df
|
||||
- etc
|
||||
|
|
@ -102,7 +103,7 @@ imports:
|
|||
- schema
|
||||
- top
|
||||
- name: github.com/hashicorp/consul
|
||||
version: ad40a855bd5003eb5d4c48f791479828d6a9393e
|
||||
version: 42f60b04bba2e4391e9a95a218c873986ebeea6b
|
||||
subpackages:
|
||||
- api
|
||||
- name: github.com/hashicorp/go-cleanhttp
|
||||
|
|
@ -110,13 +111,13 @@ imports:
|
|||
- name: github.com/hashicorp/go-rootcerts
|
||||
version: 6bb64b370b90e7ef1fa532be9e591a81c3493e00
|
||||
- name: github.com/hashicorp/serf
|
||||
version: 65c2babe73c7a096cd24e9eeec67613eb4e436c9
|
||||
version: 91fd53b1d3e624389ed9a295a3fa380e5c7b9dfc
|
||||
subpackages:
|
||||
- coordinate
|
||||
- name: github.com/inconshreveable/mousetrap
|
||||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
|
||||
- name: github.com/kr/pty
|
||||
version: f7ee69f31298ecbe5d2b349c711e2547a617d398
|
||||
version: 2c10821df3c3cf905230d078702dfbe9404c9b23
|
||||
- name: github.com/llgcode/draw2d
|
||||
version: dcbfbe505d35de8166ccfc47ff9e4bb020473e18
|
||||
subpackages:
|
||||
|
|
@ -135,13 +136,13 @@ imports:
|
|||
- name: github.com/spf13/cobra
|
||||
version: 9495bc009a56819bdb0ddbc1a373e29c140bc674
|
||||
- name: github.com/spf13/pflag
|
||||
version: 5ccb023bc27df288a957c5e994cd44fd19619465
|
||||
version: e57e3eeb33f795204c1ca35f56c44f83227c6e66
|
||||
- name: github.com/ugorji/go
|
||||
version: ded73eae5db7e7a0ef6f55aace87a2873c5d2b74
|
||||
subpackages:
|
||||
- codec
|
||||
- name: golang.org/x/image
|
||||
version: f483456c9f61fd7c1e170033d58ef22ff5ffe291
|
||||
version: 426cfd8eeb6e08ab1932954e09e3c2cb2bc6e36d
|
||||
subpackages:
|
||||
- draw
|
||||
- font
|
||||
|
|
@ -191,7 +192,7 @@ imports:
|
|||
- storage/v1
|
||||
- transport
|
||||
- name: google.golang.org/appengine
|
||||
version: 170382fa85b10b94728989dfcf6cc818b335c952
|
||||
version: 4f7eeb5305a4ba1966344836ba4af9996b7b4e05
|
||||
subpackages:
|
||||
- internal
|
||||
- internal/app_identity
|
||||
|
|
@ -204,19 +205,27 @@ imports:
|
|||
- internal/urlfetch
|
||||
- socket
|
||||
- urlfetch
|
||||
- name: google.golang.org/genproto
|
||||
version: aa2eb687b4d3e17154372564ad8d6bf11c3cf21f
|
||||
subpackages:
|
||||
- googleapis/rpc/status
|
||||
- name: google.golang.org/grpc
|
||||
version: 8050b9cbc271307e5a716a9d782803d09b0d6f2d
|
||||
version: b15215fb911b24a5d61d57feec4233d610530464
|
||||
subpackages:
|
||||
- codes
|
||||
- credentials
|
||||
- credentials/oauth
|
||||
- grpclb/grpc_lb_v1
|
||||
- grpclog
|
||||
- health
|
||||
- health/grpc_health_v1
|
||||
- internal
|
||||
- keepalive
|
||||
- metadata
|
||||
- naming
|
||||
- peer
|
||||
- stats
|
||||
- status
|
||||
- tap
|
||||
- transport
|
||||
- name: gopkg.in/yaml.v2
|
||||
|
|
|
|||
23
glide.yaml
23
glide.yaml
|
|
@ -9,7 +9,7 @@ import:
|
|||
- package: github.com/cheggaaa/pb
|
||||
version: d7e6ca3010b6f084d8056847f55d7f572f180678
|
||||
- package: github.com/coreos/etcd
|
||||
version: 1763f7d4d1f865f7650d64a6c29983f7dc2494fb
|
||||
version: 47a8156851b5a59665421661edb7c813f8a7993e
|
||||
subpackages:
|
||||
- auth/authpb
|
||||
- client
|
||||
|
|
@ -30,7 +30,7 @@ import:
|
|||
- package: github.com/dustin/go-humanize
|
||||
version: ef638b6c2e62b857442c6443dace9366a48c0ee2
|
||||
- package: github.com/gogo/protobuf
|
||||
version: 8d70fb3182befc465c4a1eac8ad4d38ff49778e2
|
||||
version: v0.4
|
||||
subpackages:
|
||||
- gogoproto
|
||||
- proto
|
||||
|
|
@ -41,22 +41,15 @@ import:
|
|||
- jsonpb
|
||||
- proto
|
||||
- package: github.com/gonum/plot
|
||||
version: 395bf7867dd5a3c85271e0b53fb222d8516d3750
|
||||
version: 51b62dc5319d7fce41240d13e780a93e640b9a38
|
||||
subpackages:
|
||||
- palette
|
||||
- plotter
|
||||
- plotutil
|
||||
- vg
|
||||
- vg/draw
|
||||
- vg/fonts
|
||||
- vg/vgeps
|
||||
- vg/vgimg
|
||||
- vg/vgpdf
|
||||
- vg/vgsvg
|
||||
- package: github.com/gyuho/dataframe
|
||||
version: 73de2c550b1177c1640f3dacbbc1af00f913fedb
|
||||
- package: github.com/gyuho/linux-inspect
|
||||
version: 459d0d77e4e21890fcedaa601a19db7b80653a86
|
||||
version: db8def6abe6a96a20aae6ae01664cc3817a27ba0
|
||||
subpackages:
|
||||
- df
|
||||
- etc
|
||||
|
|
@ -67,7 +60,7 @@ import:
|
|||
- schema
|
||||
- top
|
||||
- package: github.com/hashicorp/consul
|
||||
version: ad40a855bd5003eb5d4c48f791479828d6a9393e
|
||||
version: 42f60b04bba2e4391e9a95a218c873986ebeea6b
|
||||
subpackages:
|
||||
- api
|
||||
- package: github.com/samuel/go-zookeeper
|
||||
|
|
@ -98,7 +91,7 @@ import:
|
|||
subpackages:
|
||||
- option
|
||||
- package: google.golang.org/grpc
|
||||
version: v1.2.1
|
||||
version: v1.4.2
|
||||
subpackages:
|
||||
- codes
|
||||
- credentials
|
||||
|
|
@ -109,10 +102,12 @@ import:
|
|||
- naming
|
||||
- peer
|
||||
- transport
|
||||
- health
|
||||
- health/grpc_health_v1
|
||||
- package: gopkg.in/yaml.v2
|
||||
version: 53feefa2559fb8dfa8d81baad31be332c97d6c77
|
||||
- package: github.com/spf13/pflag
|
||||
version: 5ccb023bc27df288a957c5e994cd44fd19619465
|
||||
version: e57e3eeb33f795204c1ca35f56c44f83227c6e66
|
||||
- package: golang.org/x/time
|
||||
version: a4bde12657593d5e90d0533a3e4fd95e635124cb
|
||||
subpackages:
|
||||
|
|
|
|||
16
stress.go
16
stress.go
|
|
@ -180,7 +180,7 @@ func (cfg *Config) Stress(databaseID string) error {
|
|||
totalKeysFunc = getTotalKeysEtcdv3
|
||||
case "zookeeper__r3_4_9", "zookeeper__r3_5_2_alpha", "zookeeper__r3_5_3_beta", "zetcd__beta":
|
||||
totalKeysFunc = getTotalKeysZk
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
totalKeysFunc = getTotalKeysConsul
|
||||
default:
|
||||
plog.Panicf("%q is unknown database ID", gcfg.DatabaseID)
|
||||
|
|
@ -251,7 +251,7 @@ func (cfg *Config) Stress(databaseID string) error {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
plog.Infof("write started [request: PUT | key: %q | database: %q]", key, gcfg.DatabaseID)
|
||||
var err error
|
||||
for i := 0; i < 7; i++ {
|
||||
|
|
@ -299,7 +299,7 @@ func (cfg *Config) Stress(databaseID string) error {
|
|||
_, err = conns[0].Create("/"+key, vals.bytes[0], zkCreateFlags, zkCreateACL)
|
||||
conns[0].Close()
|
||||
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
clients := mustCreateConnsConsul(gcfg.DatabaseEndpoints, 1)
|
||||
_, err = clients[0].Put(&consulapi.KVPair{Key: key, Value: vals.bytes[0]}, nil)
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ func newReadHandlers(gcfg dbtesterpb.ConfigClientMachineAgentControl) (rhs []Req
|
|||
conns[i].Close()
|
||||
}
|
||||
}
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
conns := mustCreateConnsConsul(gcfg.DatabaseEndpoints, gcfg.ConfigClientMachineBenchmarkOptions.ConnectionNumber)
|
||||
for i := range conns {
|
||||
rhs[i] = newGetConsul(conns[i])
|
||||
|
|
@ -420,7 +420,7 @@ func newWriteHandlers(gcfg dbtesterpb.ConfigClientMachineAgentControl) (rhs []Re
|
|||
conns[i].Close()
|
||||
}
|
||||
}
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
conns := mustCreateConnsConsul(gcfg.DatabaseEndpoints, gcfg.ConfigClientMachineBenchmarkOptions.ConnectionNumber)
|
||||
for i := range conns {
|
||||
rhs[i] = newPutConsul(conns[i])
|
||||
|
|
@ -466,7 +466,7 @@ func newReadOneshotHandlers(gcfg dbtesterpb.ConfigClientMachineAgentControl) []R
|
|||
return newGetZK(conns[0])(ctx, req)
|
||||
}
|
||||
}
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
for i := range rhs {
|
||||
rhs[i] = func(ctx context.Context, req *request) error {
|
||||
conns := mustCreateConnsConsul(gcfg.DatabaseEndpoints, 1)
|
||||
|
|
@ -514,7 +514,7 @@ func generateReads(gcfg dbtesterpb.ConfigClientMachineAgentControl, key string,
|
|||
}
|
||||
inflightReqs <- request{zkOp: op}
|
||||
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
op := consulOp{key: key}
|
||||
if gcfg.ConfigClientMachineBenchmarkOptions.StaleRead {
|
||||
op.staleRead = true
|
||||
|
|
@ -561,7 +561,7 @@ func generateWrites(gcfg dbtesterpb.ConfigClientMachineAgentControl, startIdx in
|
|||
inflightReqs <- request{etcdv3Op: clientv3.OpPut(k, vs)}
|
||||
case "zookeeper__r3_4_9", "zookeeper__r3_5_2_alpha", "zookeeper__r3_5_3_beta", "zetcd__beta":
|
||||
inflightReqs <- request{zkOp: zkOp{key: "/" + k, value: v}}
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_3", "cetcd__beta":
|
||||
case "consul__v0_7_5", "consul__v0_8_0", "consul__v0_8_4", "cetcd__beta":
|
||||
inflightReqs <- request{consulOp: consulOp{key: k, value: v}}
|
||||
default:
|
||||
plog.Panicf("%q is unknown database ID", gcfg.DatabaseID)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
set -e
|
||||
|
||||
rm -f /tmp/consul.zip
|
||||
curl -sf -o /tmp/consul.zip https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip
|
||||
curl -sf -o /tmp/consul.zip https://releases.hashicorp.com/consul/0.8.4/consul_0.8.4_linux_amd64.zip
|
||||
|
||||
rm -f ${GOPATH}/bin/consul
|
||||
unzip /tmp/consul.zip -d ${GOPATH}/bin
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
GO_VERSION=1.8.1
|
||||
GO_VERSION=1.8.3
|
||||
|
||||
sudo rm -f /usr/local/go/bin/go && sudo rm -rf /usr/local/go && sudo rm -f /bin/go
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -34,11 +34,11 @@ config_client_machine_initial:
|
|||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/05-read-3M-same-keys-1K-client
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/05-read-3M-same-keys-1K-client/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/05-read-3M-same-keys-1K-client/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/05-read-3M-same-keys-1K-client/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/05-read-3M-same-keys-1K-client/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -34,11 +34,11 @@ config_client_machine_initial:
|
|||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/04-read-3M-same-keys-best-throughput
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/04-read-3M-same-keys-best-throughput/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/04-read-3M-same-keys-best-throughput/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/04-read-3M-same-keys-best-throughput/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/04-read-3M-same-keys-best-throughput/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -9,7 +9,7 @@ nohup dbtester agent --network-interface ens4 --disk-device sda --agent-port :
|
|||
# this starts database stressing, and shuts down the database when done
|
||||
nohup dbtester control --database-id etcd__tip --config config.yaml > $HOME/control.log 2>&1 &
|
||||
nohup dbtester control --database-id zookeeper__r3_5_3_beta --config config.yaml > $HOME/control.log 2>&1 &
|
||||
nohup dbtester control --database-id consul__v0_8_3 --config config.yaml > $HOME/control.log 2>&1 &
|
||||
nohup dbtester control --database-id consul__v0_8_4 --config config.yaml > $HOME/control.log 2>&1 &
|
||||
|
||||
# analyze; get all data from remote machines
|
||||
# and specify 'analyze' configuration file,
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -34,11 +34,11 @@ config_client_machine_initial:
|
|||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/03-write-1M-keys-1000QPS
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/03-write-1M-keys-1000QPS/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/03-write-1M-keys-1000QPS/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/03-write-1M-keys-1000QPS/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/03-write-1M-keys-1000QPS/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -32,13 +32,13 @@ config_client_machine_initial:
|
|||
# set this in 'control' machine, to automate log uploading in remote 'agent' machines
|
||||
google_cloud_storage_key_path: /home/gyuho/gcloud-key.json
|
||||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput
|
||||
google_cloud_storage_sub_directory: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -196,7 +196,7 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
|
||||
zookeeper__r3_5_3_beta:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/zookeeper-r3.5.3-beta-java8
|
||||
path_prefix: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/zookeeper-r3.5.3-beta-java8
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -233,10 +233,10 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
analyze_all_aggregated_output:
|
||||
all_aggregated_output_path_csv: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/all-aggregated.csv
|
||||
all_aggregated_output_path_txt: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/all-aggregated.txt
|
||||
all_aggregated_output_path_csv: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/all-aggregated.csv
|
||||
all_aggregated_output_path_txt: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/all-aggregated.txt
|
||||
|
||||
analyze_plot_path_prefix: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput
|
||||
analyze_plot_path_prefix: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput
|
||||
analyze_plot_list:
|
||||
- column: AVG-LATENCY-MS
|
||||
x_axis: Second
|
||||
|
|
@ -299,81 +299,81 @@ analyze_plot_list:
|
|||
y_axis: Network Transmit(bytes) (Delta per Second)
|
||||
|
||||
analyze_readme:
|
||||
output_path: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/README.md
|
||||
output_path: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/README.md
|
||||
|
||||
images:
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY-ERROR-POINTS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY-ERROR-POINTS.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY-ERROR-POINTS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-LATENCY-MS-BY-KEY-ERROR-POINTS.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-THROUGHPUT
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-THROUGHPUT.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-THROUGHPUT
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-THROUGHPUT.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VOLUNTARY-CTXT-SWITCHES
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VOLUNTARY-CTXT-SWITCHES.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VOLUNTARY-CTXT-SWITCHES
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VOLUNTARY-CTXT-SWITCHES.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-NON-VOLUNTARY-CTXT-SWITCHES
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-NON-VOLUNTARY-CTXT-SWITCHES.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-NON-VOLUNTARY-CTXT-SWITCHES
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-NON-VOLUNTARY-CTXT-SWITCHES.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-CPU
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-CPU.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-CPU
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-CPU.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/MAX-CPU
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/MAX-CPU.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/MAX-CPU
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/MAX-CPU.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY-ERROR-POINTS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY-ERROR-POINTS.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY-ERROR-POINTS
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-VMRSS-MB-BY-KEY-ERROR-POINTS.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-READS-COMPLETED-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-READS-COMPLETED-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-READS-COMPLETED-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-READS-COMPLETED-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-SECTORS-READ-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-SECTORS-READ-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-SECTORS-READ-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-SECTORS-READ-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-WRITES-COMPLETED-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-WRITES-COMPLETED-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-WRITES-COMPLETED-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-WRITES-COMPLETED-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-SECTORS-WRITTEN-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-SECTORS-WRITTEN-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-SECTORS-WRITTEN-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-SECTORS-WRITTEN-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-READ-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-READ-BYTES-NUM-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-READ-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-READ-BYTES-NUM-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-WRITE-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-WRITE-BYTES-NUM-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-WRITE-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-WRITE-BYTES-NUM-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-RECEIVE-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-RECEIVE-BYTES-NUM-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-RECEIVE-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-RECEIVE-BYTES-NUM-DELTA.svg
|
||||
type: remote
|
||||
|
||||
- title: 2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-TRANSMIT-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-01-etcd-zookeeper-consul/02-write-1M-keys-best-throughput/AVG-TRANSMIT-BYTES-NUM-DELTA.svg
|
||||
- title: 2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-TRANSMIT-BYTES-NUM-DELTA
|
||||
path: https://storage.googleapis.com/dbtester-results/2017Q2-02-etcd-zookeeper-consul/write-1M-keys-best-throughput/AVG-TRANSMIT-BYTES-NUM-DELTA.svg
|
||||
type: remote
|
||||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -34,11 +34,11 @@ config_client_machine_initial:
|
|||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/01-write-1M-keys-client-variable
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/01-write-1M-keys-client-variable/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/01-write-1M-keys-client-variable/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/01-write-1M-keys-client-variable/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/01-write-1M-keys-client-variable/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -4,14 +4,14 @@ test_description: |
|
|||
- 4 machines of 16 vCPUs + 60 GB Memory + 300 GB SSD (1 for client)
|
||||
- Ubuntu 16.10 (GNU/Linux kernel 4.8.0-49-generic)
|
||||
- `ulimit -n` is 120000
|
||||
- etcd tip (Go 1.8.1, git SHA f4641accc34be80c255ff87673a1cb92342abedd)
|
||||
- etcd tip (Go 1.8.3, git SHA 47a8156851b5a59665421661edb7c813f8a7993e)
|
||||
- Zookeeper r3.5.3-beta
|
||||
- Java 8
|
||||
- javac 1.8.0_131
|
||||
- Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
|
||||
- Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
|
||||
- `/usr/bin/java -Djute.maxbuffer=33554432 -Xms50G -Xmx50G`
|
||||
- Consul v0.8.3 (Go 1.8.1)
|
||||
- Consul v0.8.4 (Go 1.8.3)
|
||||
|
||||
# common control options for all client machines
|
||||
config_client_machine_initial:
|
||||
|
|
@ -34,11 +34,11 @@ config_client_machine_initial:
|
|||
google_cloud_storage_bucket_name: dbtester-results
|
||||
google_cloud_storage_sub_directory: 2017Q2-01-etcd-zookeeper-consul/write-too-many-keys
|
||||
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_3]
|
||||
all_database_id_list: [etcd__tip, zookeeper__r3_5_3_beta, consul__v0_8_4]
|
||||
|
||||
datatbase_id_to_config_client_machine_agent_control:
|
||||
etcd__tip:
|
||||
database_description: etcd tip (Go 1.8.1)
|
||||
database_description: etcd tip (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.7
|
||||
- 10.240.0.8
|
||||
|
|
@ -140,8 +140,8 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
step3_stop_database: true
|
||||
step4_upload_logs: true
|
||||
|
||||
consul__v0_8_3:
|
||||
database_description: Consul v0.8.3 (Go 1.8.1)
|
||||
consul__v0_8_4:
|
||||
database_description: Consul v0.8.4 (Go 1.8.3)
|
||||
peer_ips:
|
||||
- 10.240.0.27
|
||||
- 10.240.0.28
|
||||
|
|
@ -177,7 +177,7 @@ datatbase_id_to_config_client_machine_agent_control:
|
|||
datatbase_id_to_config_analyze_machine_initial:
|
||||
etcd__tip:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/write-too-many-keys/etcd-tip-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/write-too-many-keys/etcd-tip-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
@ -213,9 +213,9 @@ datatbase_id_to_config_analyze_machine_initial:
|
|||
- 3-server-system-metrics-interpolated.csv
|
||||
all_aggregated_output_path: all-aggregated.csv
|
||||
|
||||
consul__v0_8_3:
|
||||
consul__v0_8_4:
|
||||
# if not empty, all test data paths are prefixed
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/write-too-many-keys/consul-v0.8.3-go1.8.1
|
||||
path_prefix: 2017Q2-01-etcd-zookeeper-consul/write-too-many-keys/consul-v0.8.4-go1.8.3
|
||||
client_system_metrics_interpolated_path: client-system-metrics-interpolated.csv
|
||||
client_latency_throughput_timeseries_path: client-latency-throughput-timeseries.csv
|
||||
client_latency_distribution_all_path: client-latency-distribution-all.csv
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ Use a custom context to set timeouts on your operations:
|
|||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// set a new key, ignoring it's previous state
|
||||
// set a new key, ignoring its previous state
|
||||
_, err := kAPI.Set(ctx, "/ping", "pong", nil)
|
||||
if err != nil {
|
||||
if err == context.DeadlineExceeded {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ type Member struct {
|
|||
PeerURLs []string `json:"peerURLs"`
|
||||
|
||||
// ClientURLs represents the HTTP(S) endpoints on which this Member
|
||||
// serves it's client-facing APIs.
|
||||
// serves its client-facing APIs.
|
||||
ClientURLs []string `json:"clientURLs"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ func parseEndpoint(endpoint string) (proto string, host string, scheme string) {
|
|||
host = url.Host
|
||||
switch url.Scheme {
|
||||
case "http", "https":
|
||||
case "unix":
|
||||
case "unix", "unixs":
|
||||
proto = "unix"
|
||||
host = url.Host + url.Path
|
||||
default:
|
||||
|
|
@ -197,7 +197,7 @@ func (c *Client) processCreds(scheme string) (creds *credentials.TransportCreden
|
|||
case "unix":
|
||||
case "http":
|
||||
creds = nil
|
||||
case "https":
|
||||
case "https", "unixs":
|
||||
if creds != nil {
|
||||
break
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ func (c *Client) dial(endpoint string, dopts ...grpc.DialOption) (*grpc.ClientCo
|
|||
|
||||
opts = append(opts, c.cfg.DialOptions...)
|
||||
|
||||
conn, err := grpc.Dial(host, opts...)
|
||||
conn, err := grpc.DialContext(c.ctx, host, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -333,7 +333,7 @@ func (c *Client) dial(endpoint string, dopts ...grpc.DialOption) (*grpc.ClientCo
|
|||
// when the cluster has a leader.
|
||||
func WithRequireLeader(ctx context.Context) context.Context {
|
||||
md := metadata.Pairs(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader)
|
||||
return metadata.NewContext(ctx, md)
|
||||
return metadata.NewOutgoingContext(ctx, md)
|
||||
}
|
||||
|
||||
func newClient(cfg *Config) (*Client, error) {
|
||||
|
|
@ -367,7 +367,9 @@ func newClient(cfg *Config) (*Client, error) {
|
|||
}
|
||||
|
||||
client.balancer = newSimpleBalancer(cfg.Endpoints)
|
||||
conn, err := client.dial("", grpc.WithBalancer(client.balancer))
|
||||
// use Endpoints[0] so that for https:// without any tls config given, then
|
||||
// grpc will assume the ServerName is in the endpoint.
|
||||
conn, err := client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer))
|
||||
if err != nil {
|
||||
client.cancel()
|
||||
client.balancer.Close()
|
||||
|
|
|
|||
|
|
@ -99,6 +99,18 @@ func (cmp *Cmp) ValueBytes() []byte {
|
|||
// WithValueBytes sets the byte slice for the comparison's value.
|
||||
func (cmp *Cmp) WithValueBytes(v []byte) { cmp.TargetUnion.(*pb.Compare_Value).Value = v }
|
||||
|
||||
// WithRange sets the comparison to scan the range [key, end).
|
||||
func (cmp Cmp) WithRange(end string) Cmp {
|
||||
cmp.RangeEnd = []byte(end)
|
||||
return cmp
|
||||
}
|
||||
|
||||
// WithPrefix sets the comparison to scan all keys prefixed by the key.
|
||||
func (cmp Cmp) WithPrefix() Cmp {
|
||||
cmp.RangeEnd = getPrefix(cmp.Key)
|
||||
return cmp
|
||||
}
|
||||
|
||||
func mustInt64(val interface{}) int64 {
|
||||
if v, ok := val.(int64); ok {
|
||||
return v
|
||||
|
|
|
|||
|
|
@ -66,11 +66,13 @@ type OpResponse struct {
|
|||
put *PutResponse
|
||||
get *GetResponse
|
||||
del *DeleteResponse
|
||||
txn *TxnResponse
|
||||
}
|
||||
|
||||
func (op OpResponse) Put() *PutResponse { return op.put }
|
||||
func (op OpResponse) Get() *GetResponse { return op.get }
|
||||
func (op OpResponse) Del() *DeleteResponse { return op.del }
|
||||
func (op OpResponse) Txn() *TxnResponse { return op.txn }
|
||||
|
||||
type kv struct {
|
||||
remote pb.KVClient
|
||||
|
|
@ -134,7 +136,6 @@ func (kv *kv) Do(ctx context.Context, op Op) (OpResponse, error) {
|
|||
func (kv *kv) do(ctx context.Context, op Op) (OpResponse, error) {
|
||||
var err error
|
||||
switch op.t {
|
||||
// TODO: handle other ops
|
||||
case tRange:
|
||||
var resp *pb.RangeResponse
|
||||
resp, err = kv.remote.Range(ctx, op.toRangeRequest(), grpc.FailFast(false))
|
||||
|
|
@ -155,6 +156,12 @@ func (kv *kv) do(ctx context.Context, op Op) (OpResponse, error) {
|
|||
if err == nil {
|
||||
return OpResponse{del: (*DeleteResponse)(resp)}, nil
|
||||
}
|
||||
case tTxn:
|
||||
var resp *pb.TxnResponse
|
||||
resp, err = kv.remote.Txn(ctx, op.toTxnRequest())
|
||||
if err == nil {
|
||||
return OpResponse{txn: (*TxnResponse)(resp)}, nil
|
||||
}
|
||||
default:
|
||||
panic("Unknown op")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ func (l *lessor) closeRequireLeader() {
|
|||
reqIdxs := 0
|
||||
// find all required leader channels, close, mark as nil
|
||||
for i, ctx := range ka.ctxs {
|
||||
md, ok := metadata.FromContext(ctx)
|
||||
md, ok := metadata.FromOutgoingContext(ctx)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
|
@ -386,7 +386,7 @@ func (l *lessor) recvKeepAliveLoop() (gerr error) {
|
|||
close(l.donec)
|
||||
l.loopErr = gerr
|
||||
for _, ka := range l.keepAlives {
|
||||
ka.Close()
|
||||
ka.close()
|
||||
}
|
||||
l.keepAlives = make(map[LeaseID]*keepAlive)
|
||||
l.mu.Unlock()
|
||||
|
|
@ -467,7 +467,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) {
|
|||
if karesp.TTL <= 0 {
|
||||
// lease expired; close all keep alive channels
|
||||
delete(l.keepAlives, karesp.ID)
|
||||
ka.Close()
|
||||
ka.close()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ func (l *lessor) deadlineLoop() {
|
|||
for id, ka := range l.keepAlives {
|
||||
if ka.deadline.Before(now) {
|
||||
// waited too long for response; lease may be expired
|
||||
ka.Close()
|
||||
ka.close()
|
||||
delete(l.keepAlives, id)
|
||||
}
|
||||
}
|
||||
|
|
@ -539,7 +539,7 @@ func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) {
|
|||
}
|
||||
}
|
||||
|
||||
func (ka *keepAlive) Close() {
|
||||
func (ka *keepAlive) close() {
|
||||
close(ka.donec)
|
||||
for _, ch := range ka.chs {
|
||||
close(ch)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const (
|
|||
tRange opType = iota + 1
|
||||
tPut
|
||||
tDeleteRange
|
||||
tTxn
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -67,10 +68,18 @@ type Op struct {
|
|||
// for put
|
||||
val []byte
|
||||
leaseID LeaseID
|
||||
|
||||
// txn
|
||||
cmps []Cmp
|
||||
thenOps []Op
|
||||
elseOps []Op
|
||||
}
|
||||
|
||||
// accesors / mutators
|
||||
|
||||
func (op Op) IsTxn() bool { return op.t == tTxn }
|
||||
func (op Op) Txn() ([]Cmp, []Op, []Op) { return op.cmps, op.thenOps, op.elseOps }
|
||||
|
||||
// KeyBytes returns the byte slice holding the Op's key.
|
||||
func (op Op) KeyBytes() []byte { return op.key }
|
||||
|
||||
|
|
@ -113,6 +122,22 @@ func (op Op) toRangeRequest() *pb.RangeRequest {
|
|||
return r
|
||||
}
|
||||
|
||||
func (op Op) toTxnRequest() *pb.TxnRequest {
|
||||
thenOps := make([]*pb.RequestOp, len(op.thenOps))
|
||||
for i, tOp := range op.thenOps {
|
||||
thenOps[i] = tOp.toRequestOp()
|
||||
}
|
||||
elseOps := make([]*pb.RequestOp, len(op.elseOps))
|
||||
for i, eOp := range op.elseOps {
|
||||
elseOps[i] = eOp.toRequestOp()
|
||||
}
|
||||
cmps := make([]*pb.Compare, len(op.cmps))
|
||||
for i := range op.cmps {
|
||||
cmps[i] = (*pb.Compare)(&op.cmps[i])
|
||||
}
|
||||
return &pb.TxnRequest{Compare: cmps, Success: thenOps, Failure: elseOps}
|
||||
}
|
||||
|
||||
func (op Op) toRequestOp() *pb.RequestOp {
|
||||
switch op.t {
|
||||
case tRange:
|
||||
|
|
@ -123,12 +148,27 @@ func (op Op) toRequestOp() *pb.RequestOp {
|
|||
case tDeleteRange:
|
||||
r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV}
|
||||
return &pb.RequestOp{Request: &pb.RequestOp_RequestDeleteRange{RequestDeleteRange: r}}
|
||||
case tTxn:
|
||||
return &pb.RequestOp{Request: &pb.RequestOp_RequestTxn{RequestTxn: op.toTxnRequest()}}
|
||||
default:
|
||||
panic("Unknown Op")
|
||||
}
|
||||
}
|
||||
|
||||
func (op Op) isWrite() bool {
|
||||
if op.t == tTxn {
|
||||
for _, tOp := range op.thenOps {
|
||||
if tOp.isWrite() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, tOp := range op.elseOps {
|
||||
if tOp.isWrite() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
return op.t != tRange
|
||||
}
|
||||
|
||||
|
|
@ -194,6 +234,10 @@ func OpPut(key, val string, opts ...OpOption) Op {
|
|||
return ret
|
||||
}
|
||||
|
||||
func OpTxn(cmps []Cmp, thenOps []Op, elseOps []Op) Op {
|
||||
return Op{t: tTxn, cmps: cmps, thenOps: thenOps, elseOps: elseOps}
|
||||
}
|
||||
|
||||
func opWatch(key string, opts ...OpOption) Op {
|
||||
ret := Op{t: tRange, key: []byte(key)}
|
||||
ret.applyOpts(opts)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import (
|
|||
mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -39,10 +40,9 @@ type WatchChan <-chan WatchResponse
|
|||
|
||||
type Watcher interface {
|
||||
// Watch watches on a key or prefix. The watched events will be returned
|
||||
// through the returned channel.
|
||||
// If the watch is slow or the required rev is compacted, the watch request
|
||||
// might be canceled from the server-side and the chan will be closed.
|
||||
// 'opts' can be: 'WithRev' and/or 'WithPrefix'.
|
||||
// through the returned channel. If revisions waiting to be sent over the
|
||||
// watch are compacted, then the watch will be canceled by the server, the
|
||||
// client will post a compacted error watch response, and the channel will close.
|
||||
Watch(ctx context.Context, key string, opts ...OpOption) WatchChan
|
||||
|
||||
// Close closes the watcher and cancels all watch requests.
|
||||
|
|
@ -65,6 +65,9 @@ type WatchResponse struct {
|
|||
Created bool
|
||||
|
||||
closeErr error
|
||||
|
||||
// cancelReason is a reason of canceling watch
|
||||
cancelReason string
|
||||
}
|
||||
|
||||
// IsCreate returns true if the event tells that the key is newly created.
|
||||
|
|
@ -85,6 +88,9 @@ func (wr *WatchResponse) Err() error {
|
|||
case wr.CompactRevision != 0:
|
||||
return v3rpc.ErrCompacted
|
||||
case wr.Canceled:
|
||||
if len(wr.cancelReason) != 0 {
|
||||
return v3rpc.Error(grpc.Errorf(codes.FailedPrecondition, "%s", wr.cancelReason))
|
||||
}
|
||||
return v3rpc.ErrFutureRev
|
||||
}
|
||||
return nil
|
||||
|
|
@ -310,14 +316,14 @@ func (w *watcher) Close() (err error) {
|
|||
w.streams = nil
|
||||
w.mu.Unlock()
|
||||
for _, wgs := range streams {
|
||||
if werr := wgs.Close(); werr != nil {
|
||||
if werr := wgs.close(); werr != nil {
|
||||
err = werr
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (w *watchGrpcStream) Close() (err error) {
|
||||
func (w *watchGrpcStream) close() (err error) {
|
||||
w.cancel()
|
||||
<-w.donec
|
||||
select {
|
||||
|
|
@ -520,10 +526,6 @@ func (w *watchGrpcStream) nextResume() *watcherStream {
|
|||
|
||||
// dispatchEvent sends a WatchResponse to the appropriate watcher stream
|
||||
func (w *watchGrpcStream) dispatchEvent(pbresp *pb.WatchResponse) bool {
|
||||
ws, ok := w.substreams[pbresp.WatchId]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
events := make([]*Event, len(pbresp.Events))
|
||||
for i, ev := range pbresp.Events {
|
||||
events[i] = (*Event)(ev)
|
||||
|
|
@ -534,6 +536,11 @@ func (w *watchGrpcStream) dispatchEvent(pbresp *pb.WatchResponse) bool {
|
|||
CompactRevision: pbresp.CompactRevision,
|
||||
Created: pbresp.Created,
|
||||
Canceled: pbresp.Canceled,
|
||||
cancelReason: pbresp.CancelReason,
|
||||
}
|
||||
ws, ok := w.substreams[pbresp.WatchId]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
select {
|
||||
case ws.recvc <- wr:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -33,6 +33,7 @@ type Result struct {
|
|||
Start time.Time
|
||||
End time.Time
|
||||
Err error
|
||||
Weight float64
|
||||
}
|
||||
|
||||
func (res *Result) Duration() time.Duration { return res.End.Sub(res.Start) }
|
||||
|
|
@ -41,17 +42,7 @@ type report struct {
|
|||
results chan Result
|
||||
precision string
|
||||
|
||||
avgTotal float64
|
||||
fastest float64
|
||||
slowest float64
|
||||
average float64
|
||||
stddev float64
|
||||
rps float64
|
||||
total time.Duration
|
||||
|
||||
errorDist map[string]int
|
||||
lats []float64
|
||||
|
||||
stats Stats
|
||||
sps *secondPoints
|
||||
}
|
||||
|
||||
|
|
@ -69,6 +60,13 @@ type Stats struct {
|
|||
TimeSeries TimeSeries
|
||||
}
|
||||
|
||||
func (s *Stats) copy() Stats {
|
||||
ss := *s
|
||||
ss.ErrorDist = copyMap(ss.ErrorDist)
|
||||
ss.Lats = copyFloats(ss.Lats)
|
||||
return ss
|
||||
}
|
||||
|
||||
// Report processes a result stream until it is closed, then produces a
|
||||
// string with information about the consumed result data.
|
||||
type Report interface {
|
||||
|
|
@ -81,12 +79,15 @@ type Report interface {
|
|||
Stats() <-chan Stats
|
||||
}
|
||||
|
||||
func NewReport(precision string) Report {
|
||||
return &report{
|
||||
func NewReport(precision string) Report { return newReport(precision) }
|
||||
|
||||
func newReport(precision string) *report {
|
||||
r := &report{
|
||||
results: make(chan Result, 16),
|
||||
precision: precision,
|
||||
errorDist: make(map[string]int),
|
||||
}
|
||||
r.stats.ErrorDist = make(map[string]int)
|
||||
return r
|
||||
}
|
||||
|
||||
func NewReportSample(precision string) Report {
|
||||
|
|
@ -112,22 +113,11 @@ func (r *report) Stats() <-chan Stats {
|
|||
go func() {
|
||||
defer close(donec)
|
||||
r.processResults()
|
||||
var ts TimeSeries
|
||||
s := r.stats.copy()
|
||||
if r.sps != nil {
|
||||
ts = r.sps.getTimeSeries()
|
||||
}
|
||||
donec <- Stats{
|
||||
AvgTotal: r.avgTotal,
|
||||
Fastest: r.fastest,
|
||||
Slowest: r.slowest,
|
||||
Average: r.average,
|
||||
Stddev: r.stddev,
|
||||
RPS: r.rps,
|
||||
Total: r.total,
|
||||
ErrorDist: copyMap(r.errorDist),
|
||||
Lats: copyFloats(r.lats),
|
||||
TimeSeries: ts,
|
||||
s.TimeSeries = r.sps.getTimeSeries()
|
||||
}
|
||||
donec <- s
|
||||
}()
|
||||
return donec
|
||||
}
|
||||
|
|
@ -147,21 +137,21 @@ func copyFloats(s []float64) (c []float64) {
|
|||
}
|
||||
|
||||
func (r *report) String() (s string) {
|
||||
if len(r.lats) > 0 {
|
||||
if len(r.stats.Lats) > 0 {
|
||||
s += fmt.Sprintf("\nSummary:\n")
|
||||
s += fmt.Sprintf(" Total:\t%s.\n", r.sec2str(r.total.Seconds()))
|
||||
s += fmt.Sprintf(" Slowest:\t%s.\n", r.sec2str(r.slowest))
|
||||
s += fmt.Sprintf(" Fastest:\t%s.\n", r.sec2str(r.fastest))
|
||||
s += fmt.Sprintf(" Average:\t%s.\n", r.sec2str(r.average))
|
||||
s += fmt.Sprintf(" Stddev:\t%s.\n", r.sec2str(r.stddev))
|
||||
s += fmt.Sprintf(" Requests/sec:\t"+r.precision+"\n", r.rps)
|
||||
s += fmt.Sprintf(" Total:\t%s.\n", r.sec2str(r.stats.Total.Seconds()))
|
||||
s += fmt.Sprintf(" Slowest:\t%s.\n", r.sec2str(r.stats.Slowest))
|
||||
s += fmt.Sprintf(" Fastest:\t%s.\n", r.sec2str(r.stats.Fastest))
|
||||
s += fmt.Sprintf(" Average:\t%s.\n", r.sec2str(r.stats.Average))
|
||||
s += fmt.Sprintf(" Stddev:\t%s.\n", r.sec2str(r.stats.Stddev))
|
||||
s += fmt.Sprintf(" Requests/sec:\t"+r.precision+"\n", r.stats.RPS)
|
||||
s += r.histogram()
|
||||
s += r.sprintLatencies()
|
||||
if r.sps != nil {
|
||||
s += fmt.Sprintf("%v\n", r.sps.getTimeSeries())
|
||||
}
|
||||
}
|
||||
if len(r.errorDist) > 0 {
|
||||
if len(r.stats.ErrorDist) > 0 {
|
||||
s += r.errors()
|
||||
}
|
||||
return s
|
||||
|
|
@ -176,17 +166,17 @@ func NewReportRate(precision string) Report {
|
|||
}
|
||||
|
||||
func (r *reportRate) String() string {
|
||||
return fmt.Sprintf(" Requests/sec:\t"+r.precision+"\n", r.rps)
|
||||
return fmt.Sprintf(" Requests/sec:\t"+r.precision+"\n", r.stats.RPS)
|
||||
}
|
||||
|
||||
func (r *report) processResult(res *Result) {
|
||||
if res.Err != nil {
|
||||
r.errorDist[res.Err.Error()]++
|
||||
r.stats.ErrorDist[res.Err.Error()]++
|
||||
return
|
||||
}
|
||||
dur := res.Duration()
|
||||
r.lats = append(r.lats, dur.Seconds())
|
||||
r.avgTotal += dur.Seconds()
|
||||
r.stats.Lats = append(r.stats.Lats, dur.Seconds())
|
||||
r.stats.AvgTotal += dur.Seconds()
|
||||
if r.sps != nil {
|
||||
r.sps.Add(res.Start, dur)
|
||||
}
|
||||
|
|
@ -197,19 +187,19 @@ func (r *report) processResults() {
|
|||
for res := range r.results {
|
||||
r.processResult(&res)
|
||||
}
|
||||
r.total = time.Since(st)
|
||||
r.stats.Total = time.Since(st)
|
||||
|
||||
r.rps = float64(len(r.lats)) / r.total.Seconds()
|
||||
r.average = r.avgTotal / float64(len(r.lats))
|
||||
for i := range r.lats {
|
||||
dev := r.lats[i] - r.average
|
||||
r.stddev += dev * dev
|
||||
r.stats.RPS = float64(len(r.stats.Lats)) / r.stats.Total.Seconds()
|
||||
r.stats.Average = r.stats.AvgTotal / float64(len(r.stats.Lats))
|
||||
for i := range r.stats.Lats {
|
||||
dev := r.stats.Lats[i] - r.stats.Average
|
||||
r.stats.Stddev += dev * dev
|
||||
}
|
||||
r.stddev = math.Sqrt(r.stddev / float64(len(r.lats)))
|
||||
sort.Float64s(r.lats)
|
||||
if len(r.lats) > 0 {
|
||||
r.fastest = r.lats[0]
|
||||
r.slowest = r.lats[len(r.lats)-1]
|
||||
r.stats.Stddev = math.Sqrt(r.stats.Stddev / float64(len(r.stats.Lats)))
|
||||
sort.Float64s(r.stats.Lats)
|
||||
if len(r.stats.Lats) > 0 {
|
||||
r.stats.Fastest = r.stats.Lats[0]
|
||||
r.stats.Slowest = r.stats.Lats[len(r.stats.Lats)-1]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -235,7 +225,7 @@ func percentiles(nums []float64) (data []float64) {
|
|||
}
|
||||
|
||||
func (r *report) sprintLatencies() string {
|
||||
data := percentiles(r.lats)
|
||||
data := percentiles(r.stats.Lats)
|
||||
s := fmt.Sprintf("\nLatency distribution:\n")
|
||||
for i := 0; i < len(pctls); i++ {
|
||||
if data[i] > 0 {
|
||||
|
|
@ -249,15 +239,15 @@ func (r *report) histogram() string {
|
|||
bc := 10
|
||||
buckets := make([]float64, bc+1)
|
||||
counts := make([]int, bc+1)
|
||||
bs := (r.slowest - r.fastest) / float64(bc)
|
||||
bs := (r.stats.Slowest - r.stats.Fastest) / float64(bc)
|
||||
for i := 0; i < bc; i++ {
|
||||
buckets[i] = r.fastest + bs*float64(i)
|
||||
buckets[i] = r.stats.Fastest + bs*float64(i)
|
||||
}
|
||||
buckets[bc] = r.slowest
|
||||
buckets[bc] = r.stats.Slowest
|
||||
var bi int
|
||||
var max int
|
||||
for i := 0; i < len(r.lats); {
|
||||
if r.lats[i] <= buckets[bi] {
|
||||
for i := 0; i < len(r.stats.Lats); {
|
||||
if r.stats.Lats[i] <= buckets[bi] {
|
||||
i++
|
||||
counts[bi]++
|
||||
if max < counts[bi] {
|
||||
|
|
@ -281,7 +271,7 @@ func (r *report) histogram() string {
|
|||
|
||||
func (r *report) errors() string {
|
||||
s := fmt.Sprintf("\nError distribution:\n")
|
||||
for err, num := range r.errorDist {
|
||||
for err, num := range r.stats.ErrorDist {
|
||||
s += fmt.Sprintf(" [%d]\t%s\n", num, err)
|
||||
}
|
||||
return s
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
// Copyright 2017 The etcd Authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// the file is borrowed from github.com/rakyll/boom/boomer/print.go
|
||||
|
||||
package report
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type weightedReport struct {
|
||||
baseReport Report
|
||||
|
||||
report *report
|
||||
results chan Result
|
||||
weightTotal float64
|
||||
}
|
||||
|
||||
// NewWeightedReport returns a report that includes
|
||||
// both weighted and unweighted statistics.
|
||||
func NewWeightedReport(r Report, precision string) Report {
|
||||
return &weightedReport{
|
||||
baseReport: r,
|
||||
report: newReport(precision),
|
||||
results: make(chan Result, 16),
|
||||
}
|
||||
}
|
||||
|
||||
func (wr *weightedReport) Results() chan<- Result { return wr.results }
|
||||
|
||||
func (wr *weightedReport) Run() <-chan string {
|
||||
donec := make(chan string, 2)
|
||||
go func() {
|
||||
defer close(donec)
|
||||
basec, rc := make(chan string, 1), make(chan Stats, 1)
|
||||
go func() { basec <- (<-wr.baseReport.Run()) }()
|
||||
go func() { rc <- (<-wr.report.Stats()) }()
|
||||
go wr.processResults()
|
||||
wr.report.stats = wr.reweighStat(<-rc)
|
||||
donec <- wr.report.String()
|
||||
donec <- (<-basec)
|
||||
}()
|
||||
return donec
|
||||
}
|
||||
|
||||
func (wr *weightedReport) Stats() <-chan Stats {
|
||||
donec := make(chan Stats, 2)
|
||||
go func() {
|
||||
defer close(donec)
|
||||
basec, rc := make(chan Stats, 1), make(chan Stats, 1)
|
||||
go func() { basec <- (<-wr.baseReport.Stats()) }()
|
||||
go func() { rc <- (<-wr.report.Stats()) }()
|
||||
go wr.processResults()
|
||||
donec <- wr.reweighStat(<-rc)
|
||||
donec <- (<-basec)
|
||||
}()
|
||||
return donec
|
||||
}
|
||||
|
||||
func (wr *weightedReport) processResults() {
|
||||
defer close(wr.report.results)
|
||||
defer close(wr.baseReport.Results())
|
||||
for res := range wr.results {
|
||||
wr.processResult(res)
|
||||
wr.baseReport.Results() <- res
|
||||
}
|
||||
}
|
||||
|
||||
func (wr *weightedReport) processResult(res Result) {
|
||||
if res.Err != nil {
|
||||
wr.report.results <- res
|
||||
return
|
||||
}
|
||||
if res.Weight == 0 {
|
||||
res.Weight = 1.0
|
||||
}
|
||||
wr.weightTotal += res.Weight
|
||||
res.End = res.Start.Add(time.Duration(float64(res.End.Sub(res.Start)) / res.Weight))
|
||||
res.Weight = 1.0
|
||||
wr.report.results <- res
|
||||
}
|
||||
|
||||
func (wr *weightedReport) reweighStat(s Stats) Stats {
|
||||
weightCoef := wr.weightTotal / float64(len(s.Lats))
|
||||
// weight > 1 => processing more than one request
|
||||
s.RPS *= weightCoef
|
||||
s.AvgTotal *= weightCoef * weightCoef
|
||||
return s
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package srv looks up DNS SRV records.
|
||||
package srv
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
var (
|
||||
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
|
||||
MinClusterVersion = "3.0.0"
|
||||
Version = "3.2.0-rc.0+git"
|
||||
Version = "3.2.0-rc.1+git"
|
||||
APIVersion = "unknown"
|
||||
|
||||
// Git SHA Value will be set during build
|
||||
|
|
|
|||
|
|
@ -1,3 +1,18 @@
|
|||
// Copyright 2013-2015 CoreOS, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Semantic Versions http://semver.org
|
||||
package semver
|
||||
|
||||
import (
|
||||
|
|
@ -29,35 +44,21 @@ func splitOff(input *string, delim string) (val string) {
|
|||
return val
|
||||
}
|
||||
|
||||
func New(version string) *Version {
|
||||
return Must(NewVersion(version))
|
||||
}
|
||||
|
||||
func NewVersion(version string) (*Version, error) {
|
||||
v := Version{}
|
||||
|
||||
dotParts := strings.SplitN(version, ".", 3)
|
||||
|
||||
if len(dotParts) != 3 {
|
||||
return nil, errors.New(fmt.Sprintf("%s is not in dotted-tri format", version))
|
||||
}
|
||||
|
||||
v.Metadata = splitOff(&dotParts[2], "+")
|
||||
v.PreRelease = PreRelease(splitOff(&dotParts[2], "-"))
|
||||
|
||||
parsed := make([]int64, 3, 3)
|
||||
|
||||
for i, v := range dotParts[:3] {
|
||||
val, err := strconv.ParseInt(v, 10, 64)
|
||||
parsed[i] = val
|
||||
if err != nil {
|
||||
if err := v.Set(version); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
v.Major = parsed[0]
|
||||
v.Minor = parsed[1]
|
||||
v.Patch = parsed[2]
|
||||
|
||||
return &v, nil
|
||||
}
|
||||
|
||||
// Must is a helper for wrapping NewVersion and will panic if err is not nil.
|
||||
func Must(v *Version, err error) *Version {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -65,45 +66,99 @@ func Must(v *Version, err error) *Version {
|
|||
return v
|
||||
}
|
||||
|
||||
func (v *Version) String() string {
|
||||
// Set parses and updates v from the given version string. Implements flag.Value
|
||||
func (v *Version) Set(version string) error {
|
||||
metadata := splitOff(&version, "+")
|
||||
preRelease := PreRelease(splitOff(&version, "-"))
|
||||
dotParts := strings.SplitN(version, ".", 3)
|
||||
|
||||
if len(dotParts) != 3 {
|
||||
return fmt.Errorf("%s is not in dotted-tri format", version)
|
||||
}
|
||||
|
||||
parsed := make([]int64, 3, 3)
|
||||
|
||||
for i, v := range dotParts[:3] {
|
||||
val, err := strconv.ParseInt(v, 10, 64)
|
||||
parsed[i] = val
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
v.Metadata = metadata
|
||||
v.PreRelease = preRelease
|
||||
v.Major = parsed[0]
|
||||
v.Minor = parsed[1]
|
||||
v.Patch = parsed[2]
|
||||
return nil
|
||||
}
|
||||
|
||||
func (v Version) String() string {
|
||||
var buffer bytes.Buffer
|
||||
|
||||
base := fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
|
||||
buffer.WriteString(base)
|
||||
fmt.Fprintf(&buffer, "%d.%d.%d", v.Major, v.Minor, v.Patch)
|
||||
|
||||
if v.PreRelease != "" {
|
||||
buffer.WriteString(fmt.Sprintf("-%s", v.PreRelease))
|
||||
fmt.Fprintf(&buffer, "-%s", v.PreRelease)
|
||||
}
|
||||
|
||||
if v.Metadata != "" {
|
||||
buffer.WriteString(fmt.Sprintf("+%s", v.Metadata))
|
||||
fmt.Fprintf(&buffer, "+%s", v.Metadata)
|
||||
}
|
||||
|
||||
return buffer.String()
|
||||
}
|
||||
|
||||
func (v *Version) LessThan(versionB Version) bool {
|
||||
versionA := *v
|
||||
cmp := recursiveCompare(versionA.Slice(), versionB.Slice())
|
||||
|
||||
if cmp == 0 {
|
||||
cmp = preReleaseCompare(versionA, versionB)
|
||||
func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
var data string
|
||||
if err := unmarshal(&data); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cmp == -1 {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
return v.Set(data)
|
||||
}
|
||||
|
||||
/* Slice converts the comparable parts of the semver into a slice of strings */
|
||||
func (v *Version) Slice() []int64 {
|
||||
func (v Version) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`"` + v.String() + `"`), nil
|
||||
}
|
||||
|
||||
func (v *Version) UnmarshalJSON(data []byte) error {
|
||||
l := len(data)
|
||||
if l == 0 || string(data) == `""` {
|
||||
return nil
|
||||
}
|
||||
if l < 2 || data[0] != '"' || data[l-1] != '"' {
|
||||
return errors.New("invalid semver string")
|
||||
}
|
||||
return v.Set(string(data[1 : l-1]))
|
||||
}
|
||||
|
||||
// Compare tests if v is less than, equal to, or greater than versionB,
|
||||
// returning -1, 0, or +1 respectively.
|
||||
func (v Version) Compare(versionB Version) int {
|
||||
if cmp := recursiveCompare(v.Slice(), versionB.Slice()); cmp != 0 {
|
||||
return cmp
|
||||
}
|
||||
return preReleaseCompare(v, versionB)
|
||||
}
|
||||
|
||||
// Equal tests if v is equal to versionB.
|
||||
func (v Version) Equal(versionB Version) bool {
|
||||
return v.Compare(versionB) == 0
|
||||
}
|
||||
|
||||
// LessThan tests if v is less than versionB.
|
||||
func (v Version) LessThan(versionB Version) bool {
|
||||
return v.Compare(versionB) < 0
|
||||
}
|
||||
|
||||
// Slice converts the comparable parts of the semver into a slice of integers.
|
||||
func (v Version) Slice() []int64 {
|
||||
return []int64{v.Major, v.Minor, v.Patch}
|
||||
}
|
||||
|
||||
func (p *PreRelease) Slice() []string {
|
||||
preRelease := string(*p)
|
||||
func (p PreRelease) Slice() []string {
|
||||
preRelease := string(p)
|
||||
return strings.Split(preRelease, ".")
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +174,7 @@ func preReleaseCompare(versionA Version, versionB Version) int {
|
|||
return -1
|
||||
}
|
||||
|
||||
// If there is a prelease, check and compare each part.
|
||||
// If there is a prerelease, check and compare each part.
|
||||
return recursivePreReleaseCompare(a.Slice(), b.Slice())
|
||||
}
|
||||
|
||||
|
|
@ -141,9 +196,12 @@ func recursiveCompare(versionA []int64, versionB []int64) int {
|
|||
}
|
||||
|
||||
func recursivePreReleaseCompare(versionA []string, versionB []string) int {
|
||||
// Handle slice length disparity.
|
||||
// A larger set of pre-release fields has a higher precedence than a smaller set,
|
||||
// if all of the preceding identifiers are equal.
|
||||
if len(versionA) == 0 {
|
||||
// Nothing to compare too, so we return 0
|
||||
if len(versionB) > 0 {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
} else if len(versionB) == 0 {
|
||||
// We're longer than versionB so return 1.
|
||||
|
|
@ -153,7 +211,8 @@ func recursivePreReleaseCompare(versionA []string, versionB []string) int {
|
|||
a := versionA[0]
|
||||
b := versionB[0]
|
||||
|
||||
aInt := false; bInt := false
|
||||
aInt := false
|
||||
bInt := false
|
||||
|
||||
aI, err := strconv.Atoi(versionA[0])
|
||||
if err == nil {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
// Copyright 2013-2015 CoreOS, Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package semver
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ The enumprefix, getters and stringer extensions can be used to remove some of th
|
|||
- goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method.
|
||||
- goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension
|
||||
- goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields.
|
||||
- goproto_registration (beta), if true, the generated files will register all messages and types against both gogo/protobuf and golang/protobuf. This is necessary when using third-party packages which read registrations from golang/protobuf (such as the grpc-gateway).
|
||||
|
||||
Less Typing and Peace of Mind is explained in their specific plugin folders godoc:
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ var E_GoprotoEnumPrefix = &proto.ExtensionDesc{
|
|||
Field: 62001,
|
||||
Name: "gogoproto.goproto_enum_prefix",
|
||||
Tag: "varint,62001,opt,name=goproto_enum_prefix,json=goprotoEnumPrefix",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoEnumStringer = &proto.ExtensionDesc{
|
||||
|
|
@ -42,6 +43,7 @@ var E_GoprotoEnumStringer = &proto.ExtensionDesc{
|
|||
Field: 62021,
|
||||
Name: "gogoproto.goproto_enum_stringer",
|
||||
Tag: "varint,62021,opt,name=goproto_enum_stringer,json=goprotoEnumStringer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EnumStringer = &proto.ExtensionDesc{
|
||||
|
|
@ -50,6 +52,7 @@ var E_EnumStringer = &proto.ExtensionDesc{
|
|||
Field: 62022,
|
||||
Name: "gogoproto.enum_stringer",
|
||||
Tag: "varint,62022,opt,name=enum_stringer,json=enumStringer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EnumCustomname = &proto.ExtensionDesc{
|
||||
|
|
@ -58,6 +61,16 @@ var E_EnumCustomname = &proto.ExtensionDesc{
|
|||
Field: 62023,
|
||||
Name: "gogoproto.enum_customname",
|
||||
Tag: "bytes,62023,opt,name=enum_customname,json=enumCustomname",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Enumdecl = &proto.ExtensionDesc{
|
||||
ExtendedType: (*google_protobuf.EnumOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 62024,
|
||||
Name: "gogoproto.enumdecl",
|
||||
Tag: "varint,62024,opt,name=enumdecl",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EnumvalueCustomname = &proto.ExtensionDesc{
|
||||
|
|
@ -66,6 +79,7 @@ var E_EnumvalueCustomname = &proto.ExtensionDesc{
|
|||
Field: 66001,
|
||||
Name: "gogoproto.enumvalue_customname",
|
||||
Tag: "bytes,66001,opt,name=enumvalue_customname,json=enumvalueCustomname",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoGettersAll = &proto.ExtensionDesc{
|
||||
|
|
@ -74,6 +88,7 @@ var E_GoprotoGettersAll = &proto.ExtensionDesc{
|
|||
Field: 63001,
|
||||
Name: "gogoproto.goproto_getters_all",
|
||||
Tag: "varint,63001,opt,name=goproto_getters_all,json=goprotoGettersAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
|
||||
|
|
@ -82,6 +97,7 @@ var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{
|
|||
Field: 63002,
|
||||
Name: "gogoproto.goproto_enum_prefix_all",
|
||||
Tag: "varint,63002,opt,name=goproto_enum_prefix_all,json=goprotoEnumPrefixAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoStringerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -90,6 +106,7 @@ var E_GoprotoStringerAll = &proto.ExtensionDesc{
|
|||
Field: 63003,
|
||||
Name: "gogoproto.goproto_stringer_all",
|
||||
Tag: "varint,63003,opt,name=goproto_stringer_all,json=goprotoStringerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_VerboseEqualAll = &proto.ExtensionDesc{
|
||||
|
|
@ -98,6 +115,7 @@ var E_VerboseEqualAll = &proto.ExtensionDesc{
|
|||
Field: 63004,
|
||||
Name: "gogoproto.verbose_equal_all",
|
||||
Tag: "varint,63004,opt,name=verbose_equal_all,json=verboseEqualAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_FaceAll = &proto.ExtensionDesc{
|
||||
|
|
@ -106,6 +124,7 @@ var E_FaceAll = &proto.ExtensionDesc{
|
|||
Field: 63005,
|
||||
Name: "gogoproto.face_all",
|
||||
Tag: "varint,63005,opt,name=face_all,json=faceAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GostringAll = &proto.ExtensionDesc{
|
||||
|
|
@ -114,6 +133,7 @@ var E_GostringAll = &proto.ExtensionDesc{
|
|||
Field: 63006,
|
||||
Name: "gogoproto.gostring_all",
|
||||
Tag: "varint,63006,opt,name=gostring_all,json=gostringAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_PopulateAll = &proto.ExtensionDesc{
|
||||
|
|
@ -122,6 +142,7 @@ var E_PopulateAll = &proto.ExtensionDesc{
|
|||
Field: 63007,
|
||||
Name: "gogoproto.populate_all",
|
||||
Tag: "varint,63007,opt,name=populate_all,json=populateAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_StringerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -130,6 +151,7 @@ var E_StringerAll = &proto.ExtensionDesc{
|
|||
Field: 63008,
|
||||
Name: "gogoproto.stringer_all",
|
||||
Tag: "varint,63008,opt,name=stringer_all,json=stringerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_OnlyoneAll = &proto.ExtensionDesc{
|
||||
|
|
@ -138,6 +160,7 @@ var E_OnlyoneAll = &proto.ExtensionDesc{
|
|||
Field: 63009,
|
||||
Name: "gogoproto.onlyone_all",
|
||||
Tag: "varint,63009,opt,name=onlyone_all,json=onlyoneAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EqualAll = &proto.ExtensionDesc{
|
||||
|
|
@ -146,6 +169,7 @@ var E_EqualAll = &proto.ExtensionDesc{
|
|||
Field: 63013,
|
||||
Name: "gogoproto.equal_all",
|
||||
Tag: "varint,63013,opt,name=equal_all,json=equalAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_DescriptionAll = &proto.ExtensionDesc{
|
||||
|
|
@ -154,6 +178,7 @@ var E_DescriptionAll = &proto.ExtensionDesc{
|
|||
Field: 63014,
|
||||
Name: "gogoproto.description_all",
|
||||
Tag: "varint,63014,opt,name=description_all,json=descriptionAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_TestgenAll = &proto.ExtensionDesc{
|
||||
|
|
@ -162,6 +187,7 @@ var E_TestgenAll = &proto.ExtensionDesc{
|
|||
Field: 63015,
|
||||
Name: "gogoproto.testgen_all",
|
||||
Tag: "varint,63015,opt,name=testgen_all,json=testgenAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_BenchgenAll = &proto.ExtensionDesc{
|
||||
|
|
@ -170,6 +196,7 @@ var E_BenchgenAll = &proto.ExtensionDesc{
|
|||
Field: 63016,
|
||||
Name: "gogoproto.benchgen_all",
|
||||
Tag: "varint,63016,opt,name=benchgen_all,json=benchgenAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_MarshalerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -178,6 +205,7 @@ var E_MarshalerAll = &proto.ExtensionDesc{
|
|||
Field: 63017,
|
||||
Name: "gogoproto.marshaler_all",
|
||||
Tag: "varint,63017,opt,name=marshaler_all,json=marshalerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_UnmarshalerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -186,6 +214,7 @@ var E_UnmarshalerAll = &proto.ExtensionDesc{
|
|||
Field: 63018,
|
||||
Name: "gogoproto.unmarshaler_all",
|
||||
Tag: "varint,63018,opt,name=unmarshaler_all,json=unmarshalerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_StableMarshalerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -194,6 +223,7 @@ var E_StableMarshalerAll = &proto.ExtensionDesc{
|
|||
Field: 63019,
|
||||
Name: "gogoproto.stable_marshaler_all",
|
||||
Tag: "varint,63019,opt,name=stable_marshaler_all,json=stableMarshalerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_SizerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -202,6 +232,7 @@ var E_SizerAll = &proto.ExtensionDesc{
|
|||
Field: 63020,
|
||||
Name: "gogoproto.sizer_all",
|
||||
Tag: "varint,63020,opt,name=sizer_all,json=sizerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -210,6 +241,7 @@ var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{
|
|||
Field: 63021,
|
||||
Name: "gogoproto.goproto_enum_stringer_all",
|
||||
Tag: "varint,63021,opt,name=goproto_enum_stringer_all,json=goprotoEnumStringerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EnumStringerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -218,6 +250,7 @@ var E_EnumStringerAll = &proto.ExtensionDesc{
|
|||
Field: 63022,
|
||||
Name: "gogoproto.enum_stringer_all",
|
||||
Tag: "varint,63022,opt,name=enum_stringer_all,json=enumStringerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -226,6 +259,7 @@ var E_UnsafeMarshalerAll = &proto.ExtensionDesc{
|
|||
Field: 63023,
|
||||
Name: "gogoproto.unsafe_marshaler_all",
|
||||
Tag: "varint,63023,opt,name=unsafe_marshaler_all,json=unsafeMarshalerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -234,6 +268,7 @@ var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{
|
|||
Field: 63024,
|
||||
Name: "gogoproto.unsafe_unmarshaler_all",
|
||||
Tag: "varint,63024,opt,name=unsafe_unmarshaler_all,json=unsafeUnmarshalerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
|
||||
|
|
@ -242,6 +277,7 @@ var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{
|
|||
Field: 63025,
|
||||
Name: "gogoproto.goproto_extensions_map_all",
|
||||
Tag: "varint,63025,opt,name=goproto_extensions_map_all,json=goprotoExtensionsMapAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
|
||||
|
|
@ -250,6 +286,7 @@ var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{
|
|||
Field: 63026,
|
||||
Name: "gogoproto.goproto_unrecognized_all",
|
||||
Tag: "varint,63026,opt,name=goproto_unrecognized_all,json=goprotoUnrecognizedAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GogoprotoImport = &proto.ExtensionDesc{
|
||||
|
|
@ -258,6 +295,7 @@ var E_GogoprotoImport = &proto.ExtensionDesc{
|
|||
Field: 63027,
|
||||
Name: "gogoproto.gogoproto_import",
|
||||
Tag: "varint,63027,opt,name=gogoproto_import,json=gogoprotoImport",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_ProtosizerAll = &proto.ExtensionDesc{
|
||||
|
|
@ -266,6 +304,7 @@ var E_ProtosizerAll = &proto.ExtensionDesc{
|
|||
Field: 63028,
|
||||
Name: "gogoproto.protosizer_all",
|
||||
Tag: "varint,63028,opt,name=protosizer_all,json=protosizerAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_CompareAll = &proto.ExtensionDesc{
|
||||
|
|
@ -274,6 +313,34 @@ var E_CompareAll = &proto.ExtensionDesc{
|
|||
Field: 63029,
|
||||
Name: "gogoproto.compare_all",
|
||||
Tag: "varint,63029,opt,name=compare_all,json=compareAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_TypedeclAll = &proto.ExtensionDesc{
|
||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 63030,
|
||||
Name: "gogoproto.typedecl_all",
|
||||
Tag: "varint,63030,opt,name=typedecl_all,json=typedeclAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_EnumdeclAll = &proto.ExtensionDesc{
|
||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 63031,
|
||||
Name: "gogoproto.enumdecl_all",
|
||||
Tag: "varint,63031,opt,name=enumdecl_all,json=enumdeclAll",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoRegistration = &proto.ExtensionDesc{
|
||||
ExtendedType: (*google_protobuf.FileOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 63032,
|
||||
Name: "gogoproto.goproto_registration",
|
||||
Tag: "varint,63032,opt,name=goproto_registration,json=goprotoRegistration",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoGetters = &proto.ExtensionDesc{
|
||||
|
|
@ -282,6 +349,7 @@ var E_GoprotoGetters = &proto.ExtensionDesc{
|
|||
Field: 64001,
|
||||
Name: "gogoproto.goproto_getters",
|
||||
Tag: "varint,64001,opt,name=goproto_getters,json=goprotoGetters",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoStringer = &proto.ExtensionDesc{
|
||||
|
|
@ -290,6 +358,7 @@ var E_GoprotoStringer = &proto.ExtensionDesc{
|
|||
Field: 64003,
|
||||
Name: "gogoproto.goproto_stringer",
|
||||
Tag: "varint,64003,opt,name=goproto_stringer,json=goprotoStringer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_VerboseEqual = &proto.ExtensionDesc{
|
||||
|
|
@ -298,6 +367,7 @@ var E_VerboseEqual = &proto.ExtensionDesc{
|
|||
Field: 64004,
|
||||
Name: "gogoproto.verbose_equal",
|
||||
Tag: "varint,64004,opt,name=verbose_equal,json=verboseEqual",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Face = &proto.ExtensionDesc{
|
||||
|
|
@ -306,6 +376,7 @@ var E_Face = &proto.ExtensionDesc{
|
|||
Field: 64005,
|
||||
Name: "gogoproto.face",
|
||||
Tag: "varint,64005,opt,name=face",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Gostring = &proto.ExtensionDesc{
|
||||
|
|
@ -314,6 +385,7 @@ var E_Gostring = &proto.ExtensionDesc{
|
|||
Field: 64006,
|
||||
Name: "gogoproto.gostring",
|
||||
Tag: "varint,64006,opt,name=gostring",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Populate = &proto.ExtensionDesc{
|
||||
|
|
@ -322,6 +394,7 @@ var E_Populate = &proto.ExtensionDesc{
|
|||
Field: 64007,
|
||||
Name: "gogoproto.populate",
|
||||
Tag: "varint,64007,opt,name=populate",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Stringer = &proto.ExtensionDesc{
|
||||
|
|
@ -330,6 +403,7 @@ var E_Stringer = &proto.ExtensionDesc{
|
|||
Field: 67008,
|
||||
Name: "gogoproto.stringer",
|
||||
Tag: "varint,67008,opt,name=stringer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Onlyone = &proto.ExtensionDesc{
|
||||
|
|
@ -338,6 +412,7 @@ var E_Onlyone = &proto.ExtensionDesc{
|
|||
Field: 64009,
|
||||
Name: "gogoproto.onlyone",
|
||||
Tag: "varint,64009,opt,name=onlyone",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Equal = &proto.ExtensionDesc{
|
||||
|
|
@ -346,6 +421,7 @@ var E_Equal = &proto.ExtensionDesc{
|
|||
Field: 64013,
|
||||
Name: "gogoproto.equal",
|
||||
Tag: "varint,64013,opt,name=equal",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Description = &proto.ExtensionDesc{
|
||||
|
|
@ -354,6 +430,7 @@ var E_Description = &proto.ExtensionDesc{
|
|||
Field: 64014,
|
||||
Name: "gogoproto.description",
|
||||
Tag: "varint,64014,opt,name=description",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Testgen = &proto.ExtensionDesc{
|
||||
|
|
@ -362,6 +439,7 @@ var E_Testgen = &proto.ExtensionDesc{
|
|||
Field: 64015,
|
||||
Name: "gogoproto.testgen",
|
||||
Tag: "varint,64015,opt,name=testgen",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Benchgen = &proto.ExtensionDesc{
|
||||
|
|
@ -370,6 +448,7 @@ var E_Benchgen = &proto.ExtensionDesc{
|
|||
Field: 64016,
|
||||
Name: "gogoproto.benchgen",
|
||||
Tag: "varint,64016,opt,name=benchgen",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Marshaler = &proto.ExtensionDesc{
|
||||
|
|
@ -378,6 +457,7 @@ var E_Marshaler = &proto.ExtensionDesc{
|
|||
Field: 64017,
|
||||
Name: "gogoproto.marshaler",
|
||||
Tag: "varint,64017,opt,name=marshaler",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Unmarshaler = &proto.ExtensionDesc{
|
||||
|
|
@ -386,6 +466,7 @@ var E_Unmarshaler = &proto.ExtensionDesc{
|
|||
Field: 64018,
|
||||
Name: "gogoproto.unmarshaler",
|
||||
Tag: "varint,64018,opt,name=unmarshaler",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_StableMarshaler = &proto.ExtensionDesc{
|
||||
|
|
@ -394,6 +475,7 @@ var E_StableMarshaler = &proto.ExtensionDesc{
|
|||
Field: 64019,
|
||||
Name: "gogoproto.stable_marshaler",
|
||||
Tag: "varint,64019,opt,name=stable_marshaler,json=stableMarshaler",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Sizer = &proto.ExtensionDesc{
|
||||
|
|
@ -402,6 +484,7 @@ var E_Sizer = &proto.ExtensionDesc{
|
|||
Field: 64020,
|
||||
Name: "gogoproto.sizer",
|
||||
Tag: "varint,64020,opt,name=sizer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_UnsafeMarshaler = &proto.ExtensionDesc{
|
||||
|
|
@ -410,6 +493,7 @@ var E_UnsafeMarshaler = &proto.ExtensionDesc{
|
|||
Field: 64023,
|
||||
Name: "gogoproto.unsafe_marshaler",
|
||||
Tag: "varint,64023,opt,name=unsafe_marshaler,json=unsafeMarshaler",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
|
||||
|
|
@ -418,6 +502,7 @@ var E_UnsafeUnmarshaler = &proto.ExtensionDesc{
|
|||
Field: 64024,
|
||||
Name: "gogoproto.unsafe_unmarshaler",
|
||||
Tag: "varint,64024,opt,name=unsafe_unmarshaler,json=unsafeUnmarshaler",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
|
||||
|
|
@ -426,6 +511,7 @@ var E_GoprotoExtensionsMap = &proto.ExtensionDesc{
|
|||
Field: 64025,
|
||||
Name: "gogoproto.goproto_extensions_map",
|
||||
Tag: "varint,64025,opt,name=goproto_extensions_map,json=goprotoExtensionsMap",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_GoprotoUnrecognized = &proto.ExtensionDesc{
|
||||
|
|
@ -434,6 +520,7 @@ var E_GoprotoUnrecognized = &proto.ExtensionDesc{
|
|||
Field: 64026,
|
||||
Name: "gogoproto.goproto_unrecognized",
|
||||
Tag: "varint,64026,opt,name=goproto_unrecognized,json=goprotoUnrecognized",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Protosizer = &proto.ExtensionDesc{
|
||||
|
|
@ -442,6 +529,7 @@ var E_Protosizer = &proto.ExtensionDesc{
|
|||
Field: 64028,
|
||||
Name: "gogoproto.protosizer",
|
||||
Tag: "varint,64028,opt,name=protosizer",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Compare = &proto.ExtensionDesc{
|
||||
|
|
@ -450,6 +538,16 @@ var E_Compare = &proto.ExtensionDesc{
|
|||
Field: 64029,
|
||||
Name: "gogoproto.compare",
|
||||
Tag: "varint,64029,opt,name=compare",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Typedecl = &proto.ExtensionDesc{
|
||||
ExtendedType: (*google_protobuf.MessageOptions)(nil),
|
||||
ExtensionType: (*bool)(nil),
|
||||
Field: 64030,
|
||||
Name: "gogoproto.typedecl",
|
||||
Tag: "varint,64030,opt,name=typedecl",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Nullable = &proto.ExtensionDesc{
|
||||
|
|
@ -458,6 +556,7 @@ var E_Nullable = &proto.ExtensionDesc{
|
|||
Field: 65001,
|
||||
Name: "gogoproto.nullable",
|
||||
Tag: "varint,65001,opt,name=nullable",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Embed = &proto.ExtensionDesc{
|
||||
|
|
@ -466,6 +565,7 @@ var E_Embed = &proto.ExtensionDesc{
|
|||
Field: 65002,
|
||||
Name: "gogoproto.embed",
|
||||
Tag: "varint,65002,opt,name=embed",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Customtype = &proto.ExtensionDesc{
|
||||
|
|
@ -474,6 +574,7 @@ var E_Customtype = &proto.ExtensionDesc{
|
|||
Field: 65003,
|
||||
Name: "gogoproto.customtype",
|
||||
Tag: "bytes,65003,opt,name=customtype",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Customname = &proto.ExtensionDesc{
|
||||
|
|
@ -482,6 +583,7 @@ var E_Customname = &proto.ExtensionDesc{
|
|||
Field: 65004,
|
||||
Name: "gogoproto.customname",
|
||||
Tag: "bytes,65004,opt,name=customname",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Jsontag = &proto.ExtensionDesc{
|
||||
|
|
@ -490,6 +592,7 @@ var E_Jsontag = &proto.ExtensionDesc{
|
|||
Field: 65005,
|
||||
Name: "gogoproto.jsontag",
|
||||
Tag: "bytes,65005,opt,name=jsontag",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Moretags = &proto.ExtensionDesc{
|
||||
|
|
@ -498,6 +601,7 @@ var E_Moretags = &proto.ExtensionDesc{
|
|||
Field: 65006,
|
||||
Name: "gogoproto.moretags",
|
||||
Tag: "bytes,65006,opt,name=moretags",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Casttype = &proto.ExtensionDesc{
|
||||
|
|
@ -506,6 +610,7 @@ var E_Casttype = &proto.ExtensionDesc{
|
|||
Field: 65007,
|
||||
Name: "gogoproto.casttype",
|
||||
Tag: "bytes,65007,opt,name=casttype",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Castkey = &proto.ExtensionDesc{
|
||||
|
|
@ -514,6 +619,7 @@ var E_Castkey = &proto.ExtensionDesc{
|
|||
Field: 65008,
|
||||
Name: "gogoproto.castkey",
|
||||
Tag: "bytes,65008,opt,name=castkey",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Castvalue = &proto.ExtensionDesc{
|
||||
|
|
@ -522,6 +628,7 @@ var E_Castvalue = &proto.ExtensionDesc{
|
|||
Field: 65009,
|
||||
Name: "gogoproto.castvalue",
|
||||
Tag: "bytes,65009,opt,name=castvalue",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Stdtime = &proto.ExtensionDesc{
|
||||
|
|
@ -530,6 +637,7 @@ var E_Stdtime = &proto.ExtensionDesc{
|
|||
Field: 65010,
|
||||
Name: "gogoproto.stdtime",
|
||||
Tag: "varint,65010,opt,name=stdtime",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
var E_Stdduration = &proto.ExtensionDesc{
|
||||
|
|
@ -538,6 +646,7 @@ var E_Stdduration = &proto.ExtensionDesc{
|
|||
Field: 65011,
|
||||
Name: "gogoproto.stdduration",
|
||||
Tag: "varint,65011,opt,name=stdduration",
|
||||
Filename: "gogo.proto",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
@ -545,6 +654,7 @@ func init() {
|
|||
proto.RegisterExtension(E_GoprotoEnumStringer)
|
||||
proto.RegisterExtension(E_EnumStringer)
|
||||
proto.RegisterExtension(E_EnumCustomname)
|
||||
proto.RegisterExtension(E_Enumdecl)
|
||||
proto.RegisterExtension(E_EnumvalueCustomname)
|
||||
proto.RegisterExtension(E_GoprotoGettersAll)
|
||||
proto.RegisterExtension(E_GoprotoEnumPrefixAll)
|
||||
|
|
@ -572,6 +682,9 @@ func init() {
|
|||
proto.RegisterExtension(E_GogoprotoImport)
|
||||
proto.RegisterExtension(E_ProtosizerAll)
|
||||
proto.RegisterExtension(E_CompareAll)
|
||||
proto.RegisterExtension(E_TypedeclAll)
|
||||
proto.RegisterExtension(E_EnumdeclAll)
|
||||
proto.RegisterExtension(E_GoprotoRegistration)
|
||||
proto.RegisterExtension(E_GoprotoGetters)
|
||||
proto.RegisterExtension(E_GoprotoStringer)
|
||||
proto.RegisterExtension(E_VerboseEqual)
|
||||
|
|
@ -594,6 +707,7 @@ func init() {
|
|||
proto.RegisterExtension(E_GoprotoUnrecognized)
|
||||
proto.RegisterExtension(E_Protosizer)
|
||||
proto.RegisterExtension(E_Compare)
|
||||
proto.RegisterExtension(E_Typedecl)
|
||||
proto.RegisterExtension(E_Nullable)
|
||||
proto.RegisterExtension(E_Embed)
|
||||
proto.RegisterExtension(E_Customtype)
|
||||
|
|
@ -610,76 +724,81 @@ func init() {
|
|||
func init() { proto.RegisterFile("gogo.proto", fileDescriptorGogo) }
|
||||
|
||||
var fileDescriptorGogo = []byte{
|
||||
// 1129 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x97, 0xc9, 0x6f, 0x1c, 0x45,
|
||||
0x14, 0x87, 0x85, 0x70, 0x64, 0xcf, 0xf3, 0x86, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0x72, 0xe3, 0xe4,
|
||||
0x9c, 0x22, 0x94, 0xb2, 0x22, 0xcb, 0xb1, 0x9c, 0x51, 0x10, 0x86, 0x91, 0x89, 0x03, 0x88, 0xc3,
|
||||
0xa8, 0x67, 0xa6, 0xdc, 0x69, 0xe8, 0xee, 0x6a, 0xba, 0xaa, 0xa3, 0x38, 0x37, 0x14, 0x16, 0x21,
|
||||
0xc4, 0x8e, 0x04, 0x09, 0x09, 0xcb, 0x81, 0x7d, 0x0d, 0xcb, 0x9d, 0x0b, 0x70, 0xe6, 0x7f, 0xe0,
|
||||
0x02, 0x84, 0xdd, 0x37, 0x5f, 0x50, 0x75, 0xbf, 0xd7, 0x53, 0xdd, 0x1e, 0xa9, 0x6a, 0x6e, 0xe3,
|
||||
0x71, 0x7d, 0xdf, 0x54, 0xbf, 0x37, 0xf5, 0x7e, 0x53, 0x00, 0xbe, 0xf0, 0xc5, 0x52, 0x92, 0x0a,
|
||||
0x25, 0x9a, 0x0d, 0xfd, 0x3a, 0x7f, 0x79, 0xe8, 0xb0, 0x2f, 0x84, 0x1f, 0xf2, 0xa3, 0xf9, 0x5f,
|
||||
0xdd, 0x6c, 0xfb, 0x68, 0x9f, 0xcb, 0x5e, 0x1a, 0x24, 0x4a, 0xa4, 0xc5, 0x62, 0x76, 0x3f, 0xcc,
|
||||
0xe3, 0xe2, 0x0e, 0x8f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
0x74, 0x36, 0x91, 0xa5, 0xb6, 0x68, 0xe3, 0xbd, 0x30, 0x77, 0x9e, 0xa7, 0x5d, 0x21, 0x79, 0x87,
|
||||
0x3f, 0x91, 0x79, 0xa1, 0x83, 0xee, 0x2a, 0xea, 0x66, 0x11, 0x5c, 0xd7, 0x9c, 0x76, 0x1d, 0x87,
|
||||
0x89, 0x6d, 0xaf, 0xc7, 0x1d, 0x14, 0xd7, 0x50, 0x31, 0xae, 0xd7, 0x6b, 0x74, 0x15, 0xa6, 0x7c,
|
||||
0x51, 0x3c, 0x92, 0x03, 0xfe, 0x36, 0xe2, 0x93, 0xc4, 0xa0, 0x22, 0x11, 0x49, 0x16, 0x7a, 0xca,
|
||||
0x65, 0x07, 0xef, 0x90, 0x82, 0x18, 0x54, 0x8c, 0x50, 0xd6, 0x77, 0x49, 0x21, 0x8d, 0x7a, 0xae,
|
||||
0xc0, 0xa4, 0x88, 0xc3, 0x1d, 0x11, 0xbb, 0x6c, 0xe2, 0x3d, 0x34, 0x00, 0x22, 0x5a, 0xb0, 0x0c,
|
||||
0x0d, 0xd7, 0x46, 0xbc, 0x8f, 0xf8, 0x04, 0xa7, 0x0e, 0xb4, 0x60, 0x96, 0x86, 0x4c, 0x20, 0x62,
|
||||
0x07, 0xc5, 0x07, 0xa8, 0x98, 0x31, 0x30, 0x7c, 0x0c, 0xc5, 0xa5, 0xf2, 0xb9, 0x8b, 0xe4, 0x43,
|
||||
0x7a, 0x0c, 0x44, 0xb0, 0x94, 0x5d, 0x1e, 0xf7, 0xce, 0xb9, 0x19, 0x3e, 0xa2, 0x52, 0x12, 0xa3,
|
||||
0x15, 0x6b, 0x30, 0x1d, 0x79, 0xa9, 0x3c, 0xe7, 0x85, 0x4e, 0xed, 0xf8, 0x18, 0x1d, 0x53, 0x25,
|
||||
0x84, 0x15, 0xc9, 0xe2, 0x51, 0x34, 0x9f, 0x50, 0x45, 0x0c, 0x0c, 0x8f, 0x9e, 0x54, 0x5e, 0x37,
|
||||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0xbd, 0x2e, 0x58, 0x24, 0x52, 0xae, 0x3c,
|
||||
0x5f, 0xda, 0xd8, 0x3f, 0x91, 0x2d, 0x01, 0x0d, 0xf7, 0x3c, 0xa9, 0x5c, 0x9e, 0xfb, 0x2f, 0x82,
|
||||
0x09, 0xd0, 0x9b, 0xd6, 0xaf, 0x1f, 0xe7, 0x3b, 0x36, 0xf6, 0x6f, 0xda, 0x34, 0xae, 0x67, 0x27,
|
||||
0xa0, 0xa1, 0x5f, 0xe6, 0xf7, 0x6d, 0x1b, 0xfc, 0x0f, 0xc2, 0x03, 0x42, 0x7f, 0xb2, 0x54, 0x7d,
|
||||
0x15, 0xd8, 0x8b, 0xfd, 0x2f, 0x76, 0x9a, 0xd6, 0xb3, 0x55, 0x98, 0x94, 0xaa, 0xdf, 0xcf, 0x52,
|
||||
0x2f, 0x1f, 0xfe, 0x16, 0xfc, 0xbf, 0xbd, 0xf2, 0x32, 0x57, 0x32, 0x27, 0x8f, 0xc0, 0x7c, 0x4f,
|
||||
0x44, 0x75, 0xf0, 0x24, 0xb4, 0x44, 0x4b, 0xb4, 0xf3, 0x63, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0xff,
|
||||
0xff, 0x3f, 0x9b, 0x2b, 0x54, 0xfc, 0x11, 0x00, 0x00,
|
||||
// 1201 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0xcb, 0x6f, 0x1c, 0x45,
|
||||
0x13, 0xc0, 0xf5, 0xe9, 0x73, 0x64, 0x6f, 0xf9, 0x85, 0xd7, 0xc6, 0x84, 0x08, 0x44, 0x72, 0xe3,
|
||||
0xe4, 0x9c, 0x22, 0x94, 0xb6, 0x22, 0xcb, 0xb1, 0x1c, 0x2b, 0x11, 0x06, 0x63, 0xe2, 0x00, 0xe2,
|
||||
0xb0, 0x9a, 0xdd, 0x6d, 0x4f, 0x06, 0x66, 0xa6, 0x87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, 0x21, 0xc5, 0x00, 0x69, 0x7d, 0x83, 0x15, 0x99, 0x91, 0xcf,
|
||||
0x05, 0x18, 0x55, 0x71, 0xb8, 0xa5, 0x62, 0x97, 0x20, 0xde, 0x24, 0x03, 0x10, 0x82, 0x82, 0x79,
|
||||
0xa8, 0xb9, 0x16, 0xe2, 0xad, 0x6d, 0xde, 0x1e, 0x5c, 0x81, 0x15, 0x98, 0xe4, 0x06, 0x15, 0xa8,
|
||||
0xd8, 0x41, 0xf1, 0x36, 0x29, 0x26, 0x0c, 0x8c, 0x6e, 0x43, 0xcb, 0x4c, 0xfb, 0xd2, 0x45, 0xf2,
|
||||
0x0e, 0xdf, 0x06, 0x21, 0x94, 0xca, 0xa6, 0x8c, 0x5b, 0x67, 0xdd, 0x0c, 0xef, 0x72, 0x2a, 0x99,
|
||||
0x41, 0xc5, 0x12, 0x8c, 0x47, 0x5e, 0x9a, 0x9d, 0xf5, 0x42, 0xa7, 0x72, 0xbc, 0x47, 0x8e, 0xb1,
|
||||
0x12, 0xa2, 0x8c, 0xe4, 0xf1, 0x20, 0x9a, 0xf7, 0x39, 0x23, 0x06, 0x46, 0x5b, 0x2f, 0xd3, 0x5e,
|
||||
0x33, 0x94, 0x8d, 0x41, 0x6c, 0x1f, 0xf0, 0xd6, 0xeb, 0xb0, 0xab, 0xa6, 0x71, 0x1e, 0x6a, 0x59,
|
||||
0x70, 0xc1, 0x49, 0xf3, 0x21, 0x57, 0xba, 0x00, 0x10, 0x7e, 0x00, 0x6e, 0xee, 0x3b, 0x26, 0x1c,
|
||||
0x64, 0x1f, 0x91, 0x6c, 0xb6, 0xcf, 0xa8, 0xa0, 0x96, 0x30, 0xa8, 0xf2, 0x63, 0x6e, 0x09, 0xb2,
|
||||
0xc7, 0xb5, 0x06, 0x33, 0x79, 0x9c, 0x79, 0x9b, 0x83, 0x65, 0xed, 0x13, 0xce, 0x5a, 0x87, 0xad,
|
||||
0x64, 0xed, 0x34, 0xcc, 0x92, 0x71, 0xb0, 0xba, 0x7e, 0xca, 0x8d, 0xb5, 0x43, 0x6f, 0x54, 0xab,
|
||||
0xfb, 0x20, 0x1c, 0x28, 0xd3, 0x79, 0x5e, 0xcb, 0x38, 0x43, 0xa6, 0x11, 0x79, 0x89, 0x83, 0xf9,
|
||||
0x3a, 0x99, 0xb9, 0xe3, 0x2f, 0x97, 0x82, 0x55, 0x2f, 0x41, 0xf9, 0xfd, 0xb0, 0x9f, 0xe5, 0x79,
|
||||
0x9c, 0xca, 0x96, 0xf2, 0xe3, 0xe0, 0x82, 0x6c, 0x3b, 0xa8, 0x3f, 0xeb, 0x29, 0xd5, 0x86, 0x81,
|
||||
0xa3, 0xf9, 0x24, 0xdc, 0x50, 0x9e, 0x55, 0x1a, 0x41, 0x94, 0xa8, 0x54, 0x5b, 0x8c, 0x9f, 0x73,
|
||||
0xa5, 0x4a, 0xee, 0x64, 0x81, 0x89, 0x65, 0x98, 0x28, 0x3e, 0xba, 0x3e, 0x92, 0x5f, 0x90, 0x68,
|
||||
0xbc, 0x4b, 0x51, 0xe3, 0x68, 0xa9, 0x28, 0xf1, 0x52, 0x97, 0xfe, 0xf7, 0x25, 0x37, 0x0e, 0x42,
|
||||
0xa8, 0x71, 0xe8, 0xad, 0x44, 0xe2, 0xb4, 0x77, 0x30, 0x7c, 0xc5, 0x8d, 0x83, 0x19, 0x52, 0xf0,
|
||||
0x81, 0xc1, 0x41, 0xf1, 0x35, 0x2b, 0x98, 0x41, 0xc5, 0x3d, 0xdd, 0x41, 0x9b, 0x4a, 0x3f, 0xc8,
|
||||
0x74, 0xea, 0xe1, 0x6a, 0x8b, 0xea, 0x9b, 0xed, 0xea, 0x21, 0x6c, 0xdd, 0x40, 0xc5, 0x29, 0x98,
|
||||
0xec, 0x39, 0x62, 0xd4, 0x6f, 0xdb, 0x63, 0x5b, 0x95, 0x59, 0xe6, 0xf9, 0xa5, 0xf0, 0xd1, 0x1d,
|
||||
0x6a, 0x46, 0xd5, 0x13, 0x86, 0xb8, 0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x6e, 0x79, 0x99, 0x76, 0xb9, 0xef, 0x3f, 0x19, 0x66, 0x00, 0x83, 0xc6, 0xeb, 0x87, 0xe5,
|
||||
0x96, 0x8d, 0xfd, 0x8b, 0x83, 0xa6, 0xf5, 0xe2, 0x18, 0xd4, 0xf0, 0xb2, 0xf8, 0x3f, 0x84, 0x0d,
|
||||
0xfe, 0x9b, 0xe0, 0x2e, 0x81, 0xbf, 0x9c, 0xe9, 0xb6, 0x0e, 0xec, 0xc9, 0xfe, 0x87, 0x2a, 0xcd,
|
||||
0xeb, 0xc5, 0x22, 0x8c, 0x66, 0xba, 0xdd, 0xce, 0xe9, 0x44, 0x63, 0xc1, 0xff, 0xdd, 0x2d, 0x5f,
|
||||
0x72, 0x4b, 0xe6, 0xf8, 0x21, 0x98, 0x6e, 0xa9, 0xa8, 0x17, 0x3c, 0x0e, 0x2b, 0x6a, 0x45, 0xad,
|
||||
0x15, 0xbb, 0xe8, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x9c, 0xec, 0xd8, 0x50, 0x13, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,14 @@ func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool {
|
||||
return proto.GetBoolExtension(enum.Options, E_Enumdecl, proto.GetBoolExtension(file.Options, E_EnumdeclAll, true))
|
||||
}
|
||||
|
||||
func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||
return proto.GetBoolExtension(message.Options, E_Typedecl, proto.GetBoolExtension(file.Options, E_TypedeclAll, true))
|
||||
}
|
||||
|
||||
func GetCustomType(field *google_protobuf.FieldDescriptorProto) string {
|
||||
if field == nil {
|
||||
return ""
|
||||
|
|
@ -343,3 +351,7 @@ func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool {
|
|||
func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool {
|
||||
return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false))
|
||||
}
|
||||
|
||||
func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool {
|
||||
return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ func setPtrCustomType(base structPointer, f field, v interface{}) {
|
|||
if v == nil {
|
||||
return
|
||||
}
|
||||
structPointer_SetStructPointer(base, f, structPointer(reflect.ValueOf(v).Pointer()))
|
||||
structPointer_SetStructPointer(base, f, toStructPointer(reflect.ValueOf(v)))
|
||||
}
|
||||
|
||||
func setCustomType(base structPointer, f field, value interface{}) {
|
||||
|
|
@ -165,7 +165,8 @@ func (o *Buffer) dec_custom_slice_bytes(p *Properties, base structPointer) error
|
|||
}
|
||||
newBas := appendStructPointer(base, p.field, p.ctype)
|
||||
|
||||
setCustomType(newBas, 0, custom)
|
||||
var zero field
|
||||
setCustomType(newBas, zero, custom)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ func (o *Buffer) dec_slice_duration(p *Properties, base structPointer) error {
|
|||
return err
|
||||
}
|
||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(reflect.PtrTo(durationType)))
|
||||
setPtrCustomType(newBas, 0, &d)
|
||||
var zero field
|
||||
setPtrCustomType(newBas, zero, &d)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1075,10 +1075,17 @@ func (o *Buffer) enc_map(p *Properties, base structPointer) error {
|
|||
|
||||
func (o *Buffer) enc_exts(p *Properties, base structPointer) error {
|
||||
exts := structPointer_Extensions(base, p.field)
|
||||
if err := encodeExtensions(exts); err != nil {
|
||||
|
||||
v, mu := exts.extensionsRead()
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
if err := encodeExtensionsMap(v); err != nil {
|
||||
return err
|
||||
}
|
||||
v, _ := exts.extensionsRead()
|
||||
|
||||
return o.enc_map_body(v)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,12 +196,10 @@ func size_ref_struct_message(p *Properties, base structPointer) int {
|
|||
// Encode a slice of references to message struct pointers ([]struct).
|
||||
func (o *Buffer) enc_slice_ref_struct_message(p *Properties, base structPointer) error {
|
||||
var state errorState
|
||||
ss := structPointer_GetStructPointer(base, p.field)
|
||||
ss1 := structPointer_GetRefStructPointer(ss, field(0))
|
||||
size := p.stype.Size()
|
||||
l := structPointer_Len(base, p.field)
|
||||
ss := structPointer_StructRefSlice(base, p.field, p.stype.Size())
|
||||
l := ss.Len()
|
||||
for i := 0; i < l; i++ {
|
||||
structp := structPointer_Add(ss1, field(uintptr(i)*size))
|
||||
structp := ss.Index(i)
|
||||
if structPointer_IsNil(structp) {
|
||||
return errRepeatedHasNil
|
||||
}
|
||||
|
|
@ -233,13 +231,11 @@ func (o *Buffer) enc_slice_ref_struct_message(p *Properties, base structPointer)
|
|||
|
||||
//TODO this is only copied, please fix this
|
||||
func size_slice_ref_struct_message(p *Properties, base structPointer) (n int) {
|
||||
ss := structPointer_GetStructPointer(base, p.field)
|
||||
ss1 := structPointer_GetRefStructPointer(ss, field(0))
|
||||
size := p.stype.Size()
|
||||
l := structPointer_Len(base, p.field)
|
||||
ss := structPointer_StructRefSlice(base, p.field, p.stype.Size())
|
||||
l := ss.Len()
|
||||
n += l * len(p.tagcode)
|
||||
for i := 0; i < l; i++ {
|
||||
structp := structPointer_Add(ss1, field(uintptr(i)*size))
|
||||
structp := ss.Index(i)
|
||||
if structPointer_IsNil(structp) {
|
||||
return // return the size up to this point
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ type ExtensionDesc struct {
|
|||
Field int32 // field number
|
||||
Name string // fully-qualified name of extension, for text formatting
|
||||
Tag string // protobuf tag style
|
||||
Filename string // name of the file in which the extension is defined
|
||||
}
|
||||
|
||||
func (ed *ExtensionDesc) repeated() bool {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
// Protocol Buffers for Go with Gadgets
|
||||
//
|
||||
// Copyright (c) 2016, The GoGo Authors. All rights reserved.
|
||||
// http://github.com/gogo/protobuf
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// +build appengine js
|
||||
|
||||
package proto
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func structPointer_FieldPointer(p structPointer, f field) structPointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func appendStructPointer(base structPointer, f field, typ reflect.Type) structPointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_InterfaceAt(p structPointer, f field, t reflect.Type) interface{} {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_InterfaceRef(p structPointer, f field, t reflect.Type) interface{} {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_GetRefStructPointer(p structPointer, f field) structPointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_Add(p structPointer, size field) structPointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_Len(p structPointer, f field) int {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_GetSliceHeader(p structPointer, f field) *reflect.SliceHeader {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_Copy(oldptr structPointer, newptr structPointer, size int) {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func structPointer_StructRefSlice(p structPointer, f field, size uintptr) *structRefSlice {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
type structRefSlice struct{}
|
||||
|
||||
func (v *structRefSlice) Len() int {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func (v *structRefSlice) Index(i int) structPointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// +build !appengine
|
||||
// +build !appengine,!js
|
||||
|
||||
// This file contains the implementation of the proto field accesses using package unsafe.
|
||||
|
||||
|
|
@ -105,3 +105,24 @@ func structPointer_Add(p structPointer, size field) structPointer {
|
|||
func structPointer_Len(p structPointer, f field) int {
|
||||
return len(*(*[]interface{})(unsafe.Pointer(structPointer_GetRefStructPointer(p, f))))
|
||||
}
|
||||
|
||||
func structPointer_StructRefSlice(p structPointer, f field, size uintptr) *structRefSlice {
|
||||
return &structRefSlice{p: p, f: f, size: size}
|
||||
}
|
||||
|
||||
// A structRefSlice represents a slice of structs (themselves submessages or groups).
|
||||
type structRefSlice struct {
|
||||
p structPointer
|
||||
f field
|
||||
size uintptr
|
||||
}
|
||||
|
||||
func (v *structRefSlice) Len() int {
|
||||
return structPointer_Len(v.p, v.f)
|
||||
}
|
||||
|
||||
func (v *structRefSlice) Index(i int) structPointer {
|
||||
ss := structPointer_GetStructPointer(v.p, v.f)
|
||||
ss1 := structPointer_GetRefStructPointer(ss, 0)
|
||||
return structPointer_Add(ss1, field(uintptr(i)*v.size))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@ func (o *Buffer) dec_slice_time(p *Properties, base structPointer) error {
|
|||
return err
|
||||
}
|
||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(reflect.PtrTo(timeType)))
|
||||
setPtrCustomType(newBas, 0, &t)
|
||||
var zero field
|
||||
setPtrCustomType(newBas, zero, &t)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +95,8 @@ func (o *Buffer) dec_slice_ref_time(p *Properties, base structPointer) error {
|
|||
return err
|
||||
}
|
||||
newBas := appendStructPointer(base, p.field, reflect.SliceOf(timeType))
|
||||
setCustomType(newBas, 0, &t)
|
||||
var zero field
|
||||
setCustomType(newBas, zero, &t)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
118
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go
generated
vendored
Normal file
118
vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go
generated
vendored
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
// Go support for Protocol Buffers - Google's data interchange format
|
||||
//
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// https://github.com/golang/protobuf
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Package descriptor provides functions for obtaining protocol buffer
|
||||
// descriptors for generated Go types.
|
||||
//
|
||||
// These functions cannot go in package proto because they depend on the
|
||||
// generated protobuf descriptor messages, which themselves depend on proto.
|
||||
package descriptor
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
)
|
||||
|
||||
// extractFile extracts a FileDescriptorProto from a gzip'd buffer.
|
||||
func extractFile(gz []byte) (*FileDescriptorProto, error) {
|
||||
r, err := gzip.NewReader(bytes.NewReader(gz))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open gzip reader: %v", err)
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
b, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to uncompress descriptor: %v", err)
|
||||
}
|
||||
|
||||
fd := new(FileDescriptorProto)
|
||||
if err := proto.Unmarshal(b, fd); err != nil {
|
||||
return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err)
|
||||
}
|
||||
|
||||
return fd, nil
|
||||
}
|
||||
|
||||
// Message is a proto.Message with a method to return its descriptor.
|
||||
//
|
||||
// Message types generated by the protocol compiler always satisfy
|
||||
// the Message interface.
|
||||
type Message interface {
|
||||
proto.Message
|
||||
Descriptor() ([]byte, []int)
|
||||
}
|
||||
|
||||
// ForMessage returns a FileDescriptorProto and a DescriptorProto from within it
|
||||
// describing the given message.
|
||||
func ForMessage(msg Message) (fd *FileDescriptorProto, md *DescriptorProto) {
|
||||
gz, path := msg.Descriptor()
|
||||
fd, err := extractFile(gz)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("invalid FileDescriptorProto for %T: %v", msg, err))
|
||||
}
|
||||
|
||||
md = fd.MessageType[path[0]]
|
||||
for _, i := range path[1:] {
|
||||
md = md.NestedType[i]
|
||||
}
|
||||
return fd, md
|
||||
}
|
||||
|
||||
// Is this field a scalar numeric type?
|
||||
func (field *FieldDescriptorProto) IsScalar() bool {
|
||||
if field.Type == nil {
|
||||
return false
|
||||
}
|
||||
switch *field.Type {
|
||||
case FieldDescriptorProto_TYPE_DOUBLE,
|
||||
FieldDescriptorProto_TYPE_FLOAT,
|
||||
FieldDescriptorProto_TYPE_INT64,
|
||||
FieldDescriptorProto_TYPE_UINT64,
|
||||
FieldDescriptorProto_TYPE_INT32,
|
||||
FieldDescriptorProto_TYPE_FIXED64,
|
||||
FieldDescriptorProto_TYPE_FIXED32,
|
||||
FieldDescriptorProto_TYPE_BOOL,
|
||||
FieldDescriptorProto_TYPE_UINT32,
|
||||
FieldDescriptorProto_TYPE_ENUM,
|
||||
FieldDescriptorProto_TYPE_SFIXED32,
|
||||
FieldDescriptorProto_TYPE_SFIXED64,
|
||||
FieldDescriptorProto_TYPE_SINT32,
|
||||
FieldDescriptorProto_TYPE_SINT64:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
@ -1942,7 +1942,7 @@ func init() { proto.RegisterFile("descriptor.proto", fileDescriptorDescriptor) }
|
|||
|
||||
var fileDescriptorDescriptor = []byte{
|
||||
// 2273 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0xdb, 0xc8,
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x6f, 0xdb, 0xc8,
|
||||
0x15, 0x5f, 0xea, 0xcb, 0xd2, 0x93, 0x2c, 0x8f, 0xc7, 0xde, 0x84, 0x71, 0x36, 0x1b, 0x47, 0x9b,
|
||||
0x34, 0x4e, 0xd2, 0x3a, 0x0b, 0xe7, 0x63, 0xb3, 0xde, 0x62, 0x0b, 0x59, 0x62, 0xbc, 0x0a, 0x64,
|
||||
0x4b, 0xa5, 0xec, 0x36, 0xbb, 0x3d, 0x10, 0x63, 0x72, 0x24, 0x33, 0xa1, 0x86, 0x2c, 0x49, 0x25,
|
||||
|
|
|
|||
|
|
@ -99,6 +99,17 @@ func (field *FieldDescriptorProto) GetKeyUint64() (x uint64) {
|
|||
return x
|
||||
}
|
||||
|
||||
func (field *FieldDescriptorProto) GetKey3Uint64() (x uint64) {
|
||||
packed := field.IsPacked3()
|
||||
wireType := field.WireType()
|
||||
fieldNumber := field.GetNumber()
|
||||
if packed {
|
||||
wireType = 2
|
||||
}
|
||||
x = uint64(uint32(fieldNumber)<<3 | uint32(wireType))
|
||||
return x
|
||||
}
|
||||
|
||||
func (field *FieldDescriptorProto) GetKey() []byte {
|
||||
x := field.GetKeyUint64()
|
||||
i := 0
|
||||
|
|
@ -111,6 +122,18 @@ func (field *FieldDescriptorProto) GetKey() []byte {
|
|||
return keybuf
|
||||
}
|
||||
|
||||
func (field *FieldDescriptorProto) GetKey3() []byte {
|
||||
x := field.GetKey3Uint64()
|
||||
i := 0
|
||||
keybuf := make([]byte, 0)
|
||||
for i = 0; x > 127; i++ {
|
||||
keybuf = append(keybuf, 0x80|uint8(x&0x7F))
|
||||
x >>= 7
|
||||
}
|
||||
keybuf = append(keybuf, uint8(x))
|
||||
return keybuf
|
||||
}
|
||||
|
||||
func (desc *FileDescriptorSet) GetField(packageName, messageName, fieldName string) *FieldDescriptorProto {
|
||||
msg := desc.GetMessage(packageName, messageName)
|
||||
if msg == nil {
|
||||
|
|
@ -352,6 +375,16 @@ func (f *FieldDescriptorProto) IsPacked() bool {
|
|||
return f.Options != nil && f.GetOptions().GetPacked()
|
||||
}
|
||||
|
||||
func (f *FieldDescriptorProto) IsPacked3() bool {
|
||||
if f.IsRepeated() && f.IsScalar() {
|
||||
if f.Options == nil || f.GetOptions().Packed == nil {
|
||||
return true
|
||||
}
|
||||
return f.Options != nil && f.GetOptions().GetPacked()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *DescriptorProto) HasExtension() bool {
|
||||
return len(m.ExtensionRange) > 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,155 @@
|
|||
// Code generated by protoc-gen-go.
|
||||
// source: github.com/golang/protobuf/ptypes/any/any.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package any is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
github.com/golang/protobuf/ptypes/any/any.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Any
|
||||
*/
|
||||
package any
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// `Any` contains an arbitrary serialized protocol buffer message along with a
|
||||
// URL that describes the type of the serialized message.
|
||||
//
|
||||
// Protobuf library provides support to pack/unpack Any values in the form
|
||||
// of utility functions or additional generated methods of the Any type.
|
||||
//
|
||||
// Example 1: Pack and unpack a message in C++.
|
||||
//
|
||||
// Foo foo = ...;
|
||||
// Any any;
|
||||
// any.PackFrom(foo);
|
||||
// ...
|
||||
// if (any.UnpackTo(&foo)) {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// Example 2: Pack and unpack a message in Java.
|
||||
//
|
||||
// Foo foo = ...;
|
||||
// Any any = Any.pack(foo);
|
||||
// ...
|
||||
// if (any.is(Foo.class)) {
|
||||
// foo = any.unpack(Foo.class);
|
||||
// }
|
||||
//
|
||||
// Example 3: Pack and unpack a message in Python.
|
||||
//
|
||||
// foo = Foo(...)
|
||||
// any = Any()
|
||||
// any.Pack(foo)
|
||||
// ...
|
||||
// if any.Is(Foo.DESCRIPTOR):
|
||||
// any.Unpack(foo)
|
||||
// ...
|
||||
//
|
||||
// The pack methods provided by protobuf library will by default use
|
||||
// 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
||||
// methods only use the fully qualified type name after the last '/'
|
||||
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
||||
// name "y.z".
|
||||
//
|
||||
//
|
||||
// JSON
|
||||
// ====
|
||||
// The JSON representation of an `Any` value uses the regular
|
||||
// representation of the deserialized, embedded message, with an
|
||||
// additional field `@type` which contains the type URL. Example:
|
||||
//
|
||||
// package google.profile;
|
||||
// message Person {
|
||||
// string first_name = 1;
|
||||
// string last_name = 2;
|
||||
// }
|
||||
//
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.profile.Person",
|
||||
// "firstName": <string>,
|
||||
// "lastName": <string>
|
||||
// }
|
||||
//
|
||||
// If the embedded message type is well-known and has a custom JSON
|
||||
// representation, that representation will be embedded adding a field
|
||||
// `value` which holds the custom JSON in addition to the `@type`
|
||||
// field. Example (for message [google.protobuf.Duration][]):
|
||||
//
|
||||
// {
|
||||
// "@type": "type.googleapis.com/google.protobuf.Duration",
|
||||
// "value": "1.212s"
|
||||
// }
|
||||
//
|
||||
type Any struct {
|
||||
// A URL/resource name whose content describes the type of the
|
||||
// serialized protocol buffer message.
|
||||
//
|
||||
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
||||
// following restrictions and interpretations apply:
|
||||
//
|
||||
// * If no scheme is provided, `https` is assumed.
|
||||
// * The last segment of the URL's path must represent the fully
|
||||
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
||||
// The name should be in a canonical form (e.g., leading "." is
|
||||
// not accepted).
|
||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
// value in binary format, or produce an error.
|
||||
// * Applications are allowed to cache lookup results based on the
|
||||
// URL, or have them precompiled into a binary to avoid any
|
||||
// lookup. Therefore, binary compatibility needs to be preserved
|
||||
// on changes to types. (Use versioned type names to manage
|
||||
// breaking changes.)
|
||||
//
|
||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
// used with implementation specific semantics.
|
||||
//
|
||||
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
|
||||
// Must be a valid serialized protocol buffer of the above specified type.
|
||||
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Any) Reset() { *m = Any{} }
|
||||
func (m *Any) String() string { return proto.CompactTextString(m) }
|
||||
func (*Any) ProtoMessage() {}
|
||||
func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
func (*Any) XXX_WellKnownType() string { return "Any" }
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("github.com/golang/protobuf/ptypes/any/any.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 187 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0xcf, 0x2c, 0xc9,
|
||||
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28,
|
||||
0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xcc,
|
||||
0xab, 0x04, 0x61, 0x3d, 0xb0, 0xb8, 0x10, 0x7f, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x1e, 0x4c,
|
||||
0x95, 0x92, 0x19, 0x17, 0xb3, 0x63, 0x5e, 0xa5, 0x90, 0x24, 0x17, 0x07, 0x48, 0x79, 0x7c, 0x69,
|
||||
0x51, 0x8e, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x3b, 0x88, 0x1f, 0x5a, 0x94, 0x23, 0x24,
|
||||
0xc2, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a, 0x2a, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0xe1,
|
||||
0x38, 0x15, 0x71, 0x09, 0x27, 0xe7, 0xe7, 0xea, 0xa1, 0x19, 0xe7, 0xc4, 0xe1, 0x98, 0x57, 0x19,
|
||||
0x00, 0xe2, 0x04, 0x30, 0x46, 0xa9, 0x12, 0xe5, 0xb8, 0x05, 0x8c, 0x8c, 0x8b, 0x98, 0x98, 0xdd,
|
||||
0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x4c, 0x0b, 0x80, 0xaa, 0xd2, 0x0b, 0x4f, 0xcd, 0xc9,
|
||||
0xf1, 0xce, 0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0xa9, 0x4e, 0x62, 0x03, 0x6b, 0x37, 0x06, 0x04, 0x00,
|
||||
0x00, 0xff, 0xff, 0xc6, 0x4d, 0x03, 0x23, 0xf6, 0x00, 0x00, 0x00,
|
||||
}
|
||||
|
|
@ -38,57 +38,105 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
#define X_PTR SI
|
||||
#define Y_PTR DI
|
||||
#define DST_PTR DI
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define INC_X R8
|
||||
#define INCx3_X R11
|
||||
#define INC_Y R9
|
||||
#define INCx3_Y R12
|
||||
#define INC_DST R9
|
||||
#define INCx3_DST R12
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
|
||||
TEXT ·AxpyInc(SB), NOSPLIT, $0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ y+32(FP), R9
|
||||
MOVQ n+56(FP), DX
|
||||
MOVQ incX+64(FP), R11
|
||||
MOVQ incY+72(FP), R12
|
||||
MOVQ ix+80(FP), SI
|
||||
MOVQ iy+88(FP), DI
|
||||
MOVQ x_base+8(FP), X_PTR // X_PTR = &x
|
||||
MOVQ y_base+32(FP), Y_PTR // Y_PTR = &y
|
||||
MOVQ n+56(FP), LEN // LEN = n
|
||||
CMPQ LEN, $0 // if LEN == 0 { return }
|
||||
JE end
|
||||
|
||||
MOVQ SI, AX // nextX = ix
|
||||
MOVQ DI, BX // nextY = iy
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incY
|
||||
SHLQ $1, R11 // incX *= 2
|
||||
SHLQ $1, R12 // incY *= 2
|
||||
MOVQ ix+80(FP), INC_X
|
||||
MOVQ iy+88(FP), INC_Y
|
||||
LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix])
|
||||
LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(y[iy])
|
||||
MOVQ Y_PTR, DST_PTR // DST_PTR = Y_PTR // Write pointer
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JL tail // if n < 0
|
||||
MOVQ incX+64(FP), INC_X // INC_X = incX * sizeof(float64)
|
||||
SHLQ $3, INC_X
|
||||
MOVQ incY+72(FP), INC_Y // INC_Y = incY * sizeof(float64)
|
||||
SHLQ $3, INC_Y
|
||||
|
||||
loop: // n >= 0
|
||||
// y[i] += alpha * x[i] unrolled 2x.
|
||||
MOVHPD 0(R8)(SI*8), X0
|
||||
MOVHPD 0(R9)(DI*8), X1
|
||||
MOVLPD 0(R8)(AX*8), X0
|
||||
MOVLPD 0(R9)(BX*8), X1
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVHPD X1, 0(R9)(DI*8)
|
||||
MOVLPD X1, 0(R9)(BX*8)
|
||||
MOVSD alpha+0(FP), ALPHA // ALPHA = alpha
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $3, TAIL // TAIL = n % 4
|
||||
SHRQ $2, LEN // LEN = floor( n / 4 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
ADDQ R11, SI // ix += incX
|
||||
ADDQ R12, DI // iy += incY
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incY
|
||||
MOVAPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining
|
||||
LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3
|
||||
LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
loop: // do { // y[i] += alpha * x[i] unrolled 4x.
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MOVSD (X_PTR)(INC_X*2), X4
|
||||
MOVSD (X_PTR)(INCx3_X*1), X5
|
||||
|
||||
tail:
|
||||
ADDQ $2, DX // n += 2
|
||||
JLE end // if n <= 0
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA_2, X3
|
||||
MULSD ALPHA, X4
|
||||
MULSD ALPHA_2, X5
|
||||
|
||||
// y[i] += alpha * x[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(DI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R9)(DI*8)
|
||||
ADDSD (Y_PTR), X2 // X_i += y[i]
|
||||
ADDSD (Y_PTR)(INC_Y*1), X3
|
||||
ADDSD (Y_PTR)(INC_Y*2), X4
|
||||
ADDSD (Y_PTR)(INCx3_Y*1), X5
|
||||
|
||||
MOVSD X2, (DST_PTR) // y[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
MOVSD X4, (DST_PTR)(INC_DST*2)
|
||||
MOVSD X5, (DST_PTR)(INCx3_DST*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4])
|
||||
LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4])
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0 // if TAIL == 0 { return }
|
||||
JE end
|
||||
|
||||
tail_start: // Reset Loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( LEN / 2 )
|
||||
JZ tail_one
|
||||
|
||||
tail_two:
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA, X3
|
||||
ADDSD (Y_PTR), X2 // X_i += y[i]
|
||||
ADDSD (Y_PTR)(INC_Y*1), X3
|
||||
MOVSD X2, (DST_PTR) // y[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2])
|
||||
LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2])
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { goto end }
|
||||
|
||||
tail_one:
|
||||
// y[i] += alpha * x[i] for the last n % 4 iterations.
|
||||
MOVSD (X_PTR), X2 // X2 = x[i]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR), X2 // X2 += y[i]
|
||||
MOVSD X2, (DST_PTR) // y[i] = X2
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,65 +38,111 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DaxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
|
||||
#define X_PTR SI
|
||||
#define Y_PTR DI
|
||||
#define DST_PTR DX
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define INC_X R8
|
||||
#define INCx3_X R11
|
||||
#define INC_Y R9
|
||||
#define INCx3_Y R12
|
||||
#define INC_DST R10
|
||||
#define INCx3_DST R13
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
|
||||
TEXT ·AxpyIncTo(SB), NOSPLIT, $0
|
||||
MOVQ dst+0(FP), R10
|
||||
MOVQ incDst+24(FP), R13
|
||||
MOVQ idst+32(FP), BP
|
||||
MOVHPD alpha+40(FP), X7
|
||||
MOVLPD alpha+40(FP), X7
|
||||
MOVQ x+48(FP), R8
|
||||
MOVQ y+72(FP), R9
|
||||
MOVQ n+96(FP), DX
|
||||
MOVQ incX+104(FP), R11
|
||||
MOVQ incY+112(FP), R12
|
||||
MOVQ ix+120(FP), SI
|
||||
MOVQ iy+128(FP), DI
|
||||
MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst
|
||||
MOVQ x_base+48(FP), X_PTR // X_PTR := &x
|
||||
MOVQ y_base+72(FP), Y_PTR // Y_PTR := &y
|
||||
MOVQ n+96(FP), LEN // LEN := n
|
||||
CMPQ LEN, $0 // if LEN == 0 { return }
|
||||
JE end
|
||||
|
||||
MOVQ SI, AX // nextX = ix
|
||||
MOVQ DI, BX // nextY = iy
|
||||
MOVQ BP, CX // nextDst = idst
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incY
|
||||
ADDQ R13, CX // nextDst += incDst
|
||||
SHLQ $1, R11 // incX *= 2
|
||||
SHLQ $1, R12 // incY *= 2
|
||||
SHLQ $1, R13 // incDst *= 2
|
||||
MOVQ ix+120(FP), INC_X
|
||||
LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix])
|
||||
MOVQ iy+128(FP), INC_Y
|
||||
LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(dst[idst])
|
||||
MOVQ idst+32(FP), INC_DST
|
||||
LEAQ (DST_PTR)(INC_DST*8), DST_PTR // DST_PTR = &(y[iy])
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JL tail // if n < 0
|
||||
MOVQ incX+104(FP), INC_X // INC_X = incX * sizeof(float64)
|
||||
SHLQ $3, INC_X
|
||||
MOVQ incY+112(FP), INC_Y // INC_Y = incY * sizeof(float64)
|
||||
SHLQ $3, INC_Y
|
||||
MOVQ incDst+24(FP), INC_DST // INC_DST = incDst * sizeof(float64)
|
||||
SHLQ $3, INC_DST
|
||||
MOVSD alpha+40(FP), ALPHA
|
||||
|
||||
loop: // n >= 0
|
||||
// dst[i] = alpha * x[i] + y[i] unrolled 2x.
|
||||
MOVHPD 0(R8)(SI*8), X0
|
||||
MOVHPD 0(R9)(DI*8), X1
|
||||
MOVLPD 0(R8)(AX*8), X0
|
||||
MOVLPD 0(R9)(BX*8), X1
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVHPD X1, 0(R10)(BP*8)
|
||||
MOVLPD X1, 0(R10)(CX*8)
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $3, TAIL // TAIL = n % 4
|
||||
SHRQ $2, LEN // LEN = floor( n / 4 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
ADDQ R11, SI // ix += incX
|
||||
ADDQ R12, DI // iy += incY
|
||||
ADDQ R13, BP // idst += incDst
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incY
|
||||
ADDQ R13, CX // nextDst += incDst
|
||||
MOVSD ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining
|
||||
LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3
|
||||
LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3
|
||||
LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
loop: // do { // y[i] += alpha * x[i] unrolled 2x.
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MOVSD (X_PTR)(INC_X*2), X4
|
||||
MOVSD (X_PTR)(INCx3_X*1), X5
|
||||
|
||||
tail:
|
||||
ADDQ $2, DX // n += 2
|
||||
JLE end // if n <= 0
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA_2, X3
|
||||
MULSD ALPHA, X4
|
||||
MULSD ALPHA_2, X5
|
||||
|
||||
// dst[i] = alpha * x[i] + y[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(DI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R10)(BP*8)
|
||||
ADDSD (Y_PTR), X2 // X_i += y[i]
|
||||
ADDSD (Y_PTR)(INC_Y*1), X3
|
||||
ADDSD (Y_PTR)(INC_Y*2), X4
|
||||
ADDSD (Y_PTR)(INCx3_Y*1), X5
|
||||
|
||||
MOVSD X2, (DST_PTR) // y[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
MOVSD X4, (DST_PTR)(INC_DST*2)
|
||||
MOVSD X5, (DST_PTR)(INCx3_DST*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4])
|
||||
LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4])
|
||||
LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4]
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0 // if TAIL == 0 { return }
|
||||
JE end
|
||||
|
||||
tail_start: // Reset Loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( LEN / 2 )
|
||||
JZ tail_one
|
||||
|
||||
tail_two:
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA, X3
|
||||
ADDSD (Y_PTR), X2 // X_i += y[i]
|
||||
ADDSD (Y_PTR)(INC_Y*1), X3
|
||||
MOVSD X2, (DST_PTR) // y[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2])
|
||||
LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2])
|
||||
LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incY*2]
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { goto end }
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR), X2 // X2 = x[i]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR), X2 // X2 += y[i]
|
||||
MOVSD X2, (DST_PTR) // y[i] = X2
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,41 +38,97 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DaxpyUnitary(alpha float64, x, y []float64)
|
||||
// This function assumes len(y) >= len(x).
|
||||
#define X_PTR SI
|
||||
#define Y_PTR DI
|
||||
#define DST_PTR DI
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func AxpyUnitary(alpha float64, x, y []float64)
|
||||
TEXT ·AxpyUnitary(SB), NOSPLIT, $0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ x_len+16(FP), DI // n = len(x)
|
||||
MOVQ y+32(FP), R9
|
||||
MOVQ x_base+8(FP), X_PTR // X_PTR := &x
|
||||
MOVQ y_base+32(FP), Y_PTR // Y_PTR := &y
|
||||
MOVQ x_len+16(FP), LEN // LEN = min( len(x), len(y) )
|
||||
CMPQ y_len+40(FP), LEN
|
||||
CMOVQLE y_len+40(FP), LEN
|
||||
CMPQ LEN, $0 // if LEN == 0 { return }
|
||||
JE end
|
||||
XORQ IDX, IDX
|
||||
MOVSD alpha+0(FP), ALPHA // ALPHA := { alpha, alpha }
|
||||
SHUFPD $0, ALPHA, ALPHA
|
||||
MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining
|
||||
MOVQ Y_PTR, TAIL // Check memory alignment
|
||||
ANDQ $15, TAIL // TAIL = &y % 16
|
||||
JZ no_trim // if TAIL == 0 { goto no_trim }
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
SUBQ $2, DI // n -= 2
|
||||
JL tail // if n < 0 goto tail
|
||||
// Align on 16-byte boundary
|
||||
MOVSD (X_PTR), X2 // X2 := x[0]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR), X2 // X2 += y[0]
|
||||
MOVSD X2, (DST_PTR) // y[0] = X2
|
||||
INCQ IDX // i++
|
||||
DECQ LEN // LEN--
|
||||
JZ end // if LEN == 0 { return }
|
||||
|
||||
loop:
|
||||
// y[i] += alpha * x[i] unrolled 2x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 0(R9)(SI*8), X1
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVUPD X1, 0(R9)(SI*8)
|
||||
no_trim:
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $7, TAIL // TAIL := n % 8
|
||||
SHRQ $3, LEN // LEN = floor( n / 8 )
|
||||
JZ tail_start // if LEN == 0 { goto tail2_start }
|
||||
|
||||
ADDQ $2, SI // i += 2
|
||||
SUBQ $2, DI // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
loop: // do {
|
||||
// y[i] += alpha * x[i] unrolled 8x.
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MOVUPS 16(X_PTR)(IDX*8), X3
|
||||
MOVUPS 32(X_PTR)(IDX*8), X4
|
||||
MOVUPS 48(X_PTR)(IDX*8), X5
|
||||
|
||||
tail:
|
||||
ADDQ $2, DI // n += 2
|
||||
JLE end // if n <= 0 goto end
|
||||
MULPD ALPHA, X2 // X_i *= a
|
||||
MULPD ALPHA_2, X3
|
||||
MULPD ALPHA, X4
|
||||
MULPD ALPHA_2, X5
|
||||
|
||||
// y[i] += alpha * x[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(SI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R9)(SI*8)
|
||||
ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i]
|
||||
ADDPD 16(Y_PTR)(IDX*8), X3
|
||||
ADDPD 32(Y_PTR)(IDX*8), X4
|
||||
ADDPD 48(Y_PTR)(IDX*8), X5
|
||||
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i
|
||||
MOVUPS X3, 16(DST_PTR)(IDX*8)
|
||||
MOVUPS X4, 32(DST_PTR)(IDX*8)
|
||||
MOVUPS X5, 48(DST_PTR)(IDX*8)
|
||||
|
||||
ADDQ $8, IDX // i += 8
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0 // if TAIL == 0 { return }
|
||||
JE end
|
||||
|
||||
tail_start: // Reset loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( TAIL / 2 )
|
||||
JZ tail_one // if TAIL == 0 { goto tail }
|
||||
|
||||
tail_two: // do {
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i]
|
||||
MULPD ALPHA, X2 // X2 *= a
|
||||
ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i]
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2
|
||||
ADDQ $2, IDX // i += 2
|
||||
DECQ LEN
|
||||
JNZ tail_two // } while --LEN > 0
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { goto end }
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i]
|
||||
MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,42 +38,103 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DaxpyUnitaryTo(dst []float64, alpha float64, x, y []float64)
|
||||
// This function assumes len(y) >= len(x) and len(dst) >= len(x).
|
||||
#define X_PTR SI
|
||||
#define Y_PTR DX
|
||||
#define DST_PTR DI
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64)
|
||||
TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0
|
||||
MOVQ dst+0(FP), R10
|
||||
MOVHPD alpha+24(FP), X7
|
||||
MOVLPD alpha+24(FP), X7
|
||||
MOVQ x+32(FP), R8
|
||||
MOVQ x_len+40(FP), DI // n = len(x)
|
||||
MOVQ y+56(FP), R9
|
||||
MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst
|
||||
MOVQ x_base+32(FP), X_PTR // X_PTR := &x
|
||||
MOVQ y_base+56(FP), Y_PTR // Y_PTR := &y
|
||||
MOVQ x_len+40(FP), LEN // LEN = min( len(x), len(y), len(dst) )
|
||||
CMPQ y_len+64(FP), LEN
|
||||
CMOVQLE y_len+64(FP), LEN
|
||||
CMPQ dst_len+8(FP), LEN
|
||||
CMOVQLE dst_len+8(FP), LEN
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
SUBQ $2, DI // n -= 2
|
||||
JL tail // if n < 0 goto tail
|
||||
CMPQ LEN, $0
|
||||
JE end // if LEN == 0 { return }
|
||||
|
||||
loop:
|
||||
// dst[i] = alpha * x[i] + y[i] unrolled 2x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 0(R9)(SI*8), X1
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVUPD X1, 0(R10)(SI*8)
|
||||
XORQ IDX, IDX // IDX = 0
|
||||
MOVSD alpha+24(FP), ALPHA
|
||||
SHUFPD $0, ALPHA, ALPHA // ALPHA := { alpha, alpha }
|
||||
MOVQ Y_PTR, TAIL // Check memory alignment
|
||||
ANDQ $15, TAIL // TAIL = &y % 16
|
||||
JZ no_trim // if TAIL == 0 { goto no_trim }
|
||||
|
||||
ADDQ $2, SI // i += 2
|
||||
SUBQ $2, DI // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
// Align on 16-byte boundary
|
||||
MOVSD (X_PTR), X2 // X2 := x[0]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR), X2 // X2 += y[0]
|
||||
MOVSD X2, (DST_PTR) // y[0] = X2
|
||||
INCQ IDX // i++
|
||||
DECQ LEN // LEN--
|
||||
JZ end // if LEN == 0 { return }
|
||||
|
||||
tail:
|
||||
ADDQ $2, DI // n += 2
|
||||
JLE end // if n <= 0 goto end
|
||||
no_trim:
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $7, TAIL // TAIL := n % 8
|
||||
SHRQ $3, LEN // LEN = floor( n / 8 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
// dst[i] = alpha * x[i] + y[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(SI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R10)(SI*8)
|
||||
MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining
|
||||
|
||||
loop: // do {
|
||||
// y[i] += alpha * x[i] unrolled 8x.
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MOVUPS 16(X_PTR)(IDX*8), X3
|
||||
MOVUPS 32(X_PTR)(IDX*8), X4
|
||||
MOVUPS 48(X_PTR)(IDX*8), X5
|
||||
|
||||
MULPD ALPHA, X2 // X_i *= alpha
|
||||
MULPD ALPHA_2, X3
|
||||
MULPD ALPHA, X4
|
||||
MULPD ALPHA_2, X5
|
||||
|
||||
ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i]
|
||||
ADDPD 16(Y_PTR)(IDX*8), X3
|
||||
ADDPD 32(Y_PTR)(IDX*8), X4
|
||||
ADDPD 48(Y_PTR)(IDX*8), X5
|
||||
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i
|
||||
MOVUPS X3, 16(DST_PTR)(IDX*8)
|
||||
MOVUPS X4, 32(DST_PTR)(IDX*8)
|
||||
MOVUPS X5, 48(DST_PTR)(IDX*8)
|
||||
|
||||
ADDQ $8, IDX // i += 8
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0 // if TAIL == 0 { return }
|
||||
JE end
|
||||
|
||||
tail_start: // Reset loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( TAIL / 2 )
|
||||
JZ tail_one // if LEN == 0 { goto tail }
|
||||
|
||||
tail_two: // do {
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i]
|
||||
MULPD ALPHA, X2 // X2 *= alpha
|
||||
ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i]
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2
|
||||
ADDQ $2, IDX // i += 2
|
||||
DECQ LEN
|
||||
JNZ tail_two // } while --LEN > 0
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { goto end }
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i]
|
||||
MULSD ALPHA, X2 // X2 *= a
|
||||
ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i]
|
||||
MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,43 +38,76 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DscalInc(alpha float64, x []float64, n, incX uintptr)
|
||||
#define X_PTR SI
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define INC_X R8
|
||||
#define INCx3_X R9
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func ScalInc(alpha float64, x []float64, n, incX uintptr)
|
||||
TEXT ·ScalInc(SB), NOSPLIT, $0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ n+32(FP), DX
|
||||
MOVQ incX+40(FP), R10
|
||||
MOVSD alpha+0(FP), ALPHA // ALPHA = alpha
|
||||
MOVQ x_base+8(FP), X_PTR // X_PTR = &x
|
||||
MOVQ incX+40(FP), INC_X // INC_X = incX
|
||||
SHLQ $3, INC_X // INC_X *= sizeof(float64)
|
||||
MOVQ n+32(FP), LEN // LEN = n
|
||||
CMPQ LEN, $0
|
||||
JE end // if LEN == 0 { return }
|
||||
|
||||
MOVQ $0, SI
|
||||
MOVQ R10, AX // nextX = incX
|
||||
SHLQ $1, R10 // incX *= 2
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $3, TAIL // TAIL = LEN % 4
|
||||
SHRQ $2, LEN // LEN = floor( LEN / 4 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JL tail // if n < 0
|
||||
MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining
|
||||
LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3
|
||||
|
||||
loop:
|
||||
// x[i] *= alpha unrolled 2x.
|
||||
MOVHPD 0(R8)(SI*8), X0
|
||||
MOVLPD 0(R8)(AX*8), X0
|
||||
MULPD X7, X0
|
||||
MOVHPD X0, 0(R8)(SI*8)
|
||||
MOVLPD X0, 0(R8)(AX*8)
|
||||
loop: // do { // x[i] *= alpha unrolled 4x.
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MOVSD (X_PTR)(INC_X*2), X4
|
||||
MOVSD (X_PTR)(INCx3_X*1), X5
|
||||
|
||||
ADDQ R10, SI // ix += incX
|
||||
ADDQ R10, AX // nextX += incX
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA_2, X3
|
||||
MULSD ALPHA, X4
|
||||
MULSD ALPHA_2, X5
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
MOVSD X2, (X_PTR) // x[i] = X_i
|
||||
MOVSD X3, (X_PTR)(INC_X*1)
|
||||
MOVSD X4, (X_PTR)(INC_X*2)
|
||||
MOVSD X5, (X_PTR)(INCx3_X*1)
|
||||
|
||||
tail:
|
||||
ADDQ $2, DX // n += 2
|
||||
JLE end // if n <= 0
|
||||
LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4])
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0
|
||||
JE end // if TAIL == 0 { return }
|
||||
|
||||
// x[i] *= alpha for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MULSD X7, X0
|
||||
MOVSD X0, 0(R8)(SI*8)
|
||||
tail_start: // Reset loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( LEN / 2 )
|
||||
JZ tail_one
|
||||
|
||||
tail_two: // do {
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA, X3
|
||||
MOVSD X2, (X_PTR) // x[i] = X_i
|
||||
MOVSD X3, (X_PTR)(INC_X*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2])
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MULSD ALPHA, X2 // X_i *= ALPHA
|
||||
MOVSD X2, (X_PTR) // x[i] = X_i
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,50 +38,85 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DscalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr)
|
||||
#define X_PTR SI
|
||||
#define DST_PTR DI
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define INC_X R8
|
||||
#define INCx3_X R9
|
||||
#define INC_DST R10
|
||||
#define INCx3_DST R11
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr)
|
||||
TEXT ·ScalIncTo(SB), NOSPLIT, $0
|
||||
MOVQ dst+0(FP), R9
|
||||
MOVQ incDst+24(FP), R11
|
||||
MOVHPD alpha+32(FP), X7
|
||||
MOVLPD alpha+32(FP), X7
|
||||
MOVQ x+40(FP), R8
|
||||
MOVQ n+64(FP), DX
|
||||
MOVQ incX+72(FP), R10
|
||||
MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst
|
||||
MOVQ incDst+24(FP), INC_DST // INC_DST = incDst
|
||||
SHLQ $3, INC_DST // INC_DST *= sizeof(float64)
|
||||
MOVSD alpha+32(FP), ALPHA // ALPHA = alpha
|
||||
MOVQ x_base+40(FP), X_PTR // X_PTR = &x
|
||||
MOVQ n+64(FP), LEN // LEN = n
|
||||
MOVQ incX+72(FP), INC_X // INC_X = incX
|
||||
SHLQ $3, INC_X // INC_X *= sizeof(float64)
|
||||
CMPQ LEN, $0
|
||||
JE end // if LEN == 0 { return }
|
||||
|
||||
MOVQ $0, SI
|
||||
MOVQ $0, DI
|
||||
MOVQ R10, AX // nextX = incX
|
||||
MOVQ R11, BX // nextDst = incDst
|
||||
SHLQ $1, R10 // incX *= 2
|
||||
SHLQ $1, R11 // incDst *= 2
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $3, TAIL // TAIL = LEN % 4
|
||||
SHRQ $2, LEN // LEN = floor( LEN / 4 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JL tail // if n < 0
|
||||
MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining
|
||||
LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3
|
||||
LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3
|
||||
|
||||
loop:
|
||||
// dst[i] = alpha * x[i] unrolled 2x.
|
||||
MOVHPD 0(R8)(SI*8), X0
|
||||
MOVLPD 0(R8)(AX*8), X0
|
||||
MULPD X7, X0
|
||||
MOVHPD X0, 0(R9)(DI*8)
|
||||
MOVLPD X0, 0(R9)(BX*8)
|
||||
loop: // do { // x[i] *= alpha unrolled 4x.
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MOVSD (X_PTR)(INC_X*2), X4
|
||||
MOVSD (X_PTR)(INCx3_X*1), X5
|
||||
|
||||
ADDQ R10, SI // ix += incX
|
||||
ADDQ R10, AX // nextX += incX
|
||||
ADDQ R11, DI // idst += incDst
|
||||
ADDQ R11, BX // nextDst += incDst
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA_2, X3
|
||||
MULSD ALPHA, X4
|
||||
MULSD ALPHA_2, X5
|
||||
|
||||
SUBQ $2, DX // n -= 2
|
||||
JGE loop // if n >= 0 goto loop
|
||||
MOVSD X2, (DST_PTR) // dst[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
MOVSD X4, (DST_PTR)(INC_DST*2)
|
||||
MOVSD X5, (DST_PTR)(INCx3_DST*1)
|
||||
|
||||
tail:
|
||||
ADDQ $2, DX // n += 2
|
||||
JLE end // if n <= 0
|
||||
LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4])
|
||||
LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4])
|
||||
DECQ LEN
|
||||
JNZ loop // } while --LEN > 0
|
||||
CMPQ TAIL, $0
|
||||
JE end // if TAIL == 0 { return }
|
||||
|
||||
// dst[i] = alpha * x[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MULSD X7, X0
|
||||
MOVSD X0, 0(R9)(DI*8)
|
||||
tail_start: // Reset loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( LEN / 2 )
|
||||
JZ tail_one
|
||||
|
||||
tail_two:
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MOVSD (X_PTR)(INC_X*1), X3
|
||||
MULSD ALPHA, X2 // X_i *= a
|
||||
MULSD ALPHA, X3
|
||||
MOVSD X2, (DST_PTR) // dst[i] = X_i
|
||||
MOVSD X3, (DST_PTR)(INC_DST*1)
|
||||
|
||||
LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2])
|
||||
LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incDst*2])
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR), X2 // X_i = x[i]
|
||||
MULSD ALPHA, X2 // X_i *= ALPHA
|
||||
MOVSD X2, (DST_PTR) // x[i] = X_i
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,43 +38,75 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DscalUnitary(alpha float64, x []float64)
|
||||
#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // @ MOVDDUP XMM0, 8[RSP]
|
||||
|
||||
#define X_PTR SI
|
||||
#define DST_PTR DI
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func ScalUnitary(alpha float64, x []float64)
|
||||
TEXT ·ScalUnitary(SB), NOSPLIT, $0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ x_len+16(FP), DI // n = len(x)
|
||||
MOVDDUP_ALPHA // ALPHA = { alpha, alpha }
|
||||
MOVQ x_base+8(FP), X_PTR // X_PTR = &x
|
||||
MOVQ x_len+16(FP), LEN // LEN = len(x)
|
||||
CMPQ LEN, $0
|
||||
JE end // if LEN == 0 { return }
|
||||
XORQ IDX, IDX // IDX = 0
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
SUBQ $4, DI // n -= 4
|
||||
JL tail // if n < 0 goto tail
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $7, TAIL // TAIL = LEN % 8
|
||||
SHRQ $3, LEN // LEN = floor( LEN / 8 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
loop:
|
||||
// x[i] *= alpha unrolled 4x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 16(R8)(SI*8), X1
|
||||
MULPD X7, X0
|
||||
MULPD X7, X1
|
||||
MOVUPD X0, 0(R8)(SI*8)
|
||||
MOVUPD X1, 16(R8)(SI*8)
|
||||
MOVUPS ALPHA, ALPHA_2
|
||||
|
||||
ADDQ $4, SI // i += 4
|
||||
SUBQ $4, DI // n -= 4
|
||||
JGE loop // if n >= 0 goto loop
|
||||
loop: // do { // x[i] *= alpha unrolled 8x.
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MOVUPS 16(X_PTR)(IDX*8), X3
|
||||
MOVUPS 32(X_PTR)(IDX*8), X4
|
||||
MOVUPS 48(X_PTR)(IDX*8), X5
|
||||
|
||||
tail:
|
||||
ADDQ $4, DI // n += 4
|
||||
JZ end // if n == 0 goto end
|
||||
MULPD ALPHA, X2 // X_i *= ALPHA
|
||||
MULPD ALPHA_2, X3
|
||||
MULPD ALPHA, X4
|
||||
MULPD ALPHA_2, X5
|
||||
|
||||
onemore:
|
||||
// x[i] *= alpha for the remaining 1-3 elements.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MULSD X7, X0
|
||||
MOVSD X0, 0(R8)(SI*8)
|
||||
MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i
|
||||
MOVUPS X3, 16(X_PTR)(IDX*8)
|
||||
MOVUPS X4, 32(X_PTR)(IDX*8)
|
||||
MOVUPS X5, 48(X_PTR)(IDX*8)
|
||||
|
||||
ADDQ $1, SI // i++
|
||||
SUBQ $1, DI // n--
|
||||
JNZ onemore // if n != 0 goto onemore
|
||||
ADDQ $8, IDX // i += 8
|
||||
DECQ LEN
|
||||
JNZ loop // while --LEN > 0
|
||||
CMPQ TAIL, $0
|
||||
JE end // if TAIL == 0 { return }
|
||||
|
||||
tail_start: // Reset loop registers
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( TAIL / 2 )
|
||||
JZ tail_one // if n == 0 goto end
|
||||
|
||||
tail_two: // do {
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MULPD ALPHA, X2 // X_i *= ALPHA
|
||||
MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i
|
||||
ADDQ $2, IDX // i += 2
|
||||
DECQ LEN
|
||||
JNZ tail_two // while --LEN > 0
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { return }
|
||||
|
||||
tail_one:
|
||||
// x[i] *= alpha for the remaining element.
|
||||
MOVSD (X_PTR)(IDX*8), X2
|
||||
MULSD ALPHA, X2
|
||||
MOVSD X2, (X_PTR)(IDX*8)
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -38,45 +38,76 @@
|
|||
|
||||
#include "textflag.h"
|
||||
|
||||
// func DscalUnitaryTo(dst []float64, alpha float64, x []float64)
|
||||
#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x2024 // @ MOVDDUP 32(SP), X0 /*XMM0, 32[RSP]*/
|
||||
|
||||
#define X_PTR SI
|
||||
#define DST_PTR DI
|
||||
#define IDX AX
|
||||
#define LEN CX
|
||||
#define TAIL BX
|
||||
#define ALPHA X0
|
||||
#define ALPHA_2 X1
|
||||
|
||||
// func ScalUnitaryTo(dst []float64, alpha float64, x []float64)
|
||||
// This function assumes len(dst) >= len(x).
|
||||
TEXT ·ScalUnitaryTo(SB), NOSPLIT, $0
|
||||
MOVQ dst+0(FP), R9
|
||||
MOVHPD alpha+24(FP), X7
|
||||
MOVLPD alpha+24(FP), X7
|
||||
MOVQ x+32(FP), R8
|
||||
MOVQ x_len+40(FP), DI // n = len(x)
|
||||
MOVQ x_base+32(FP), X_PTR // X_PTR = &x
|
||||
MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst
|
||||
MOVDDUP_ALPHA // ALPHA = { alpha, alpha }
|
||||
MOVQ x_len+40(FP), LEN // LEN = len(x)
|
||||
CMPQ LEN, $0
|
||||
JE end // if LEN == 0 { return }
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
SUBQ $4, DI // n -= 4
|
||||
JL tail // if n < 0 goto tail
|
||||
XORQ IDX, IDX // IDX = 0
|
||||
MOVQ LEN, TAIL
|
||||
ANDQ $7, TAIL // TAIL = LEN % 8
|
||||
SHRQ $3, LEN // LEN = floor( LEN / 8 )
|
||||
JZ tail_start // if LEN == 0 { goto tail_start }
|
||||
|
||||
loop:
|
||||
// dst[i] = alpha * x[i] unrolled 4x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 16(R8)(SI*8), X1
|
||||
MULPD X7, X0
|
||||
MULPD X7, X1
|
||||
MOVUPD X0, 0(R9)(SI*8)
|
||||
MOVUPD X1, 16(R9)(SI*8)
|
||||
MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining
|
||||
|
||||
ADDQ $4, SI // i += 4
|
||||
SUBQ $4, DI // n -= 4
|
||||
JGE loop // if n >= 0 goto loop
|
||||
loop: // do { // dst[i] = alpha * x[i] unrolled 8x.
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MOVUPS 16(X_PTR)(IDX*8), X3
|
||||
MOVUPS 32(X_PTR)(IDX*8), X4
|
||||
MOVUPS 48(X_PTR)(IDX*8), X5
|
||||
|
||||
tail:
|
||||
ADDQ $4, DI // n += 4
|
||||
JZ end // if n == 0 goto end
|
||||
MULPD ALPHA, X2 // X_i *= ALPHA
|
||||
MULPD ALPHA_2, X3
|
||||
MULPD ALPHA, X4
|
||||
MULPD ALPHA_2, X5
|
||||
|
||||
onemore:
|
||||
// dst[i] = alpha * x[i] for the remaining 1-3 elements.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MULSD X7, X0
|
||||
MOVSD X0, 0(R9)(SI*8)
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i
|
||||
MOVUPS X3, 16(DST_PTR)(IDX*8)
|
||||
MOVUPS X4, 32(DST_PTR)(IDX*8)
|
||||
MOVUPS X5, 48(DST_PTR)(IDX*8)
|
||||
|
||||
ADDQ $1, SI // i++
|
||||
SUBQ $1, DI // n--
|
||||
JNZ onemore // if n != 0 goto onemore
|
||||
ADDQ $8, IDX // i += 8
|
||||
DECQ LEN
|
||||
JNZ loop // while --LEN > 0
|
||||
CMPQ TAIL, $0
|
||||
JE end // if TAIL == 0 { return }
|
||||
|
||||
tail_start: // Reset loop counters
|
||||
MOVQ TAIL, LEN // Loop counter: LEN = TAIL
|
||||
SHRQ $1, LEN // LEN = floor( TAIL / 2 )
|
||||
JZ tail_one // if LEN == 0 { goto tail_one }
|
||||
|
||||
tail_two: // do {
|
||||
MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MULPD ALPHA, X2 // X_i *= ALPHA
|
||||
MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i
|
||||
ADDQ $2, IDX // i += 2
|
||||
DECQ LEN
|
||||
JNZ tail_two // while --LEN > 0
|
||||
|
||||
ANDQ $1, TAIL
|
||||
JZ end // if TAIL == 0 { return }
|
||||
|
||||
tail_one:
|
||||
MOVSD (X_PTR)(IDX*8), X2 // X_i = x[i]
|
||||
MULSD ALPHA, X2 // X_i *= ALPHA
|
||||
MOVSD X2, (DST_PTR)(IDX*8) // dst[i] = X_i
|
||||
|
||||
end:
|
||||
RET
|
||||
|
|
|
|||
|
|
@ -164,6 +164,13 @@ func UseImageWithContext(img draw.Image, gc draw2d.GraphicContext) option {
|
|||
}
|
||||
}
|
||||
|
||||
// Image returns the image the canvas is drawing to.
|
||||
//
|
||||
// The dimensions of the returned image must not be modified.
|
||||
func (c *Canvas) Image() draw.Image {
|
||||
return c.img
|
||||
}
|
||||
|
||||
func (c *Canvas) Size() (w, h vg.Length) {
|
||||
return c.w, c.h
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import (
|
|||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// CallOption is an option used by Invoke to control behaviors of RPC calls.
|
||||
|
|
@ -80,7 +81,11 @@ type boRetryer struct {
|
|||
}
|
||||
|
||||
func (r *boRetryer) Retry(err error) (time.Duration, bool) {
|
||||
c := grpc.Code(err)
|
||||
st, ok := status.FromError(err)
|
||||
if !ok {
|
||||
return 0, false
|
||||
}
|
||||
c := st.Code()
|
||||
for _, rc := range r.codes {
|
||||
if c == rc {
|
||||
return r.backoff.Pause(), true
|
||||
|
|
@ -121,6 +126,9 @@ func (bo *Backoff) Pause() time.Duration {
|
|||
if bo.Multiplier < 1 {
|
||||
bo.Multiplier = 2
|
||||
}
|
||||
// Select a duration between zero and the current max. It might seem counterintuitive to
|
||||
// have so much jitter, but https://www.awsarchitectureblog.com/2015/03/backoff.html
|
||||
// argues that that is the best strategy.
|
||||
d := time.Duration(rand.Int63n(int64(bo.cur)))
|
||||
bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier)
|
||||
if bo.cur > bo.Max {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ type AgentServiceCheck struct {
|
|||
Timeout string `json:",omitempty"`
|
||||
TTL string `json:",omitempty"`
|
||||
HTTP string `json:",omitempty"`
|
||||
Header map[string][]string `json:",omitempty"`
|
||||
Method string `json:",omitempty"`
|
||||
TCP string `json:",omitempty"`
|
||||
Status string `json:",omitempty"`
|
||||
Notes string `json:",omitempty"`
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
|
|
@ -369,10 +370,6 @@ func NewClient(config *Config) (*Client, error) {
|
|||
config.Transport = defConfig.Transport
|
||||
}
|
||||
|
||||
if config.HttpClient == nil {
|
||||
config.HttpClient = defConfig.HttpClient
|
||||
}
|
||||
|
||||
if config.TLSConfig.Address == "" {
|
||||
config.TLSConfig.Address = defConfig.TLSConfig.Address
|
||||
}
|
||||
|
|
@ -434,6 +431,11 @@ func NewClient(config *Config) (*Client, error) {
|
|||
// NewHttpClient returns an http client configured with the given Transport and TLS
|
||||
// config.
|
||||
func NewHttpClient(transport *http.Transport, tlsConf TLSConfig) (*http.Client, error) {
|
||||
client := &http.Client{
|
||||
Transport: transport,
|
||||
}
|
||||
|
||||
if transport.TLSClientConfig == nil {
|
||||
tlsClientConfig, err := SetupTLSConfig(&tlsConf)
|
||||
|
||||
if err != nil {
|
||||
|
|
@ -441,8 +443,6 @@ func NewHttpClient(transport *http.Transport, tlsConf TLSConfig) (*http.Client,
|
|||
}
|
||||
|
||||
transport.TLSClientConfig = tlsClientConfig
|
||||
client := &http.Client{
|
||||
Transport: transport,
|
||||
}
|
||||
|
||||
return client, nil
|
||||
|
|
@ -649,6 +649,8 @@ func (c *Client) write(endpoint string, in, out interface{}, q *WriteOptions) (*
|
|||
if err := decodeBody(resp, &out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if _, err := ioutil.ReadAll(resp.Body); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return wm, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,20 @@ type Client struct {
|
|||
// value to determine how many samples we keep, per node.
|
||||
latencyFilterSamples map[string][]float64
|
||||
|
||||
// stats is used to record events that occur when updating coordinates.
|
||||
stats ClientStats
|
||||
|
||||
// mutex enables safe concurrent access to the client.
|
||||
mutex sync.RWMutex
|
||||
}
|
||||
|
||||
// ClientStats is used to record events that occur when updating coordinates.
|
||||
type ClientStats struct {
|
||||
// Resets is incremented any time we reset our local coordinate because
|
||||
// our calculations have resulted in an invalid state.
|
||||
Resets int
|
||||
}
|
||||
|
||||
// NewClient creates a new Client and verifies the configuration is valid.
|
||||
func NewClient(config *Config) (*Client, error) {
|
||||
if !(config.Dimensionality > 0) {
|
||||
|
|
@ -63,11 +73,16 @@ func (c *Client) GetCoordinate() *Coordinate {
|
|||
}
|
||||
|
||||
// SetCoordinate forces the client's coordinate to a known state.
|
||||
func (c *Client) SetCoordinate(coord *Coordinate) {
|
||||
func (c *Client) SetCoordinate(coord *Coordinate) error {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
if err := c.checkCoordinate(coord); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.coord = coord.Clone()
|
||||
return nil
|
||||
}
|
||||
|
||||
// ForgetNode removes any client state for the given node.
|
||||
|
|
@ -78,6 +93,29 @@ func (c *Client) ForgetNode(node string) {
|
|||
delete(c.latencyFilterSamples, node)
|
||||
}
|
||||
|
||||
// Stats returns a copy of stats for the client.
|
||||
func (c *Client) Stats() ClientStats {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
return c.stats
|
||||
}
|
||||
|
||||
// checkCoordinate returns an error if the coordinate isn't compatible with
|
||||
// this client, or if the coordinate itself isn't valid. This assumes the mutex
|
||||
// has been locked already.
|
||||
func (c *Client) checkCoordinate(coord *Coordinate) error {
|
||||
if !c.coord.IsCompatibleWith(coord) {
|
||||
return fmt.Errorf("dimensions aren't compatible")
|
||||
}
|
||||
|
||||
if !coord.IsValid() {
|
||||
return fmt.Errorf("coordinate is invalid")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// latencyFilter applies a simple moving median filter with a new sample for
|
||||
// a node. This assumes that the mutex has been locked already.
|
||||
func (c *Client) latencyFilter(node string, rttSeconds float64) float64 {
|
||||
|
|
@ -159,15 +197,24 @@ func (c *Client) updateGravity() {
|
|||
// Update takes other, a coordinate for another node, and rtt, a round trip
|
||||
// time observation for a ping to that node, and updates the estimated position of
|
||||
// the client's coordinate. Returns the updated coordinate.
|
||||
func (c *Client) Update(node string, other *Coordinate, rtt time.Duration) *Coordinate {
|
||||
func (c *Client) Update(node string, other *Coordinate, rtt time.Duration) (*Coordinate, error) {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
|
||||
if err := c.checkCoordinate(other); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rttSeconds := c.latencyFilter(node, rtt.Seconds())
|
||||
c.updateVivaldi(other, rttSeconds)
|
||||
c.updateAdjustment(other, rttSeconds)
|
||||
c.updateGravity()
|
||||
return c.coord.Clone()
|
||||
if !c.coord.IsValid() {
|
||||
c.stats.Resets++
|
||||
c.coord = NewCoordinate(c.config)
|
||||
}
|
||||
|
||||
return c.coord.Clone(), nil
|
||||
}
|
||||
|
||||
// DistanceTo returns the estimated RTT from the client's coordinate to other, the
|
||||
|
|
|
|||
|
|
@ -72,6 +72,26 @@ func (c *Coordinate) Clone() *Coordinate {
|
|||
}
|
||||
}
|
||||
|
||||
// componentIsValid returns false if a floating point value is a NaN or an
|
||||
// infinity.
|
||||
func componentIsValid(f float64) bool {
|
||||
return !math.IsInf(f, 0) && !math.IsNaN(f)
|
||||
}
|
||||
|
||||
// IsValid returns false if any component of a coordinate isn't valid, per the
|
||||
// componentIsValid() helper above.
|
||||
func (c *Coordinate) IsValid() bool {
|
||||
for i := range c.Vec {
|
||||
if !componentIsValid(c.Vec[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return componentIsValid(c.Error) &&
|
||||
componentIsValid(c.Adjustment) &&
|
||||
componentIsValid(c.Height)
|
||||
}
|
||||
|
||||
// IsCompatibleWith checks to see if the two coordinates are compatible
|
||||
// dimensionally. If this returns true then you are guaranteed to not get
|
||||
// any runtime errors operating on them.
|
||||
|
|
@ -122,7 +142,7 @@ func (c *Coordinate) rawDistanceTo(other *Coordinate) float64 {
|
|||
// already been checked to be compatible.
|
||||
func add(vec1 []float64, vec2 []float64) []float64 {
|
||||
ret := make([]float64, len(vec1))
|
||||
for i, _ := range ret {
|
||||
for i := range ret {
|
||||
ret[i] = vec1[i] + vec2[i]
|
||||
}
|
||||
return ret
|
||||
|
|
@ -132,7 +152,7 @@ func add(vec1 []float64, vec2 []float64) []float64 {
|
|||
// dimensions have already been checked to be compatible.
|
||||
func diff(vec1 []float64, vec2 []float64) []float64 {
|
||||
ret := make([]float64, len(vec1))
|
||||
for i, _ := range ret {
|
||||
for i := range ret {
|
||||
ret[i] = vec1[i] - vec2[i]
|
||||
}
|
||||
return ret
|
||||
|
|
@ -141,7 +161,7 @@ func diff(vec1 []float64, vec2 []float64) []float64 {
|
|||
// mul returns vec multiplied by a scalar factor.
|
||||
func mul(vec []float64, factor float64) []float64 {
|
||||
ret := make([]float64, len(vec))
|
||||
for i, _ := range vec {
|
||||
for i := range vec {
|
||||
ret[i] = vec[i] * factor
|
||||
}
|
||||
return ret
|
||||
|
|
@ -150,7 +170,7 @@ func mul(vec []float64, factor float64) []float64 {
|
|||
// magnitude computes the magnitude of the vec.
|
||||
func magnitude(vec []float64) float64 {
|
||||
sum := 0.0
|
||||
for i, _ := range vec {
|
||||
for i := range vec {
|
||||
sum += vec[i] * vec[i]
|
||||
}
|
||||
return math.Sqrt(sum)
|
||||
|
|
@ -168,7 +188,7 @@ func unitVectorAt(vec1 []float64, vec2 []float64) ([]float64, float64) {
|
|||
}
|
||||
|
||||
// Otherwise, just return a random unit vector.
|
||||
for i, _ := range ret {
|
||||
for i := range ret {
|
||||
ret[i] = rand.Float64() - 0.5
|
||||
}
|
||||
if mag := magnitude(ret); mag > zeroThreshold {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// +build !windows
|
||||
|
||||
package pty
|
||||
|
||||
import "syscall"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package pty
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// same code as pty_darwin.go
|
||||
func open() (pty, tty *os.File, err error) {
|
||||
p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
sname, err := ptsname(p)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
err = grantpt(p)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
err = unlockpt(p)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
t, err := os.OpenFile(sname, os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return p, t, nil
|
||||
}
|
||||
|
||||
func grantpt(f *os.File) error {
|
||||
_, err := isptmaster(f.Fd())
|
||||
return err
|
||||
}
|
||||
|
||||
func unlockpt(f *os.File) error {
|
||||
_, err := isptmaster(f.Fd())
|
||||
return err
|
||||
}
|
||||
|
||||
func isptmaster(fd uintptr) (bool, error) {
|
||||
err := ioctl(fd, syscall.TIOCISPTMASTER, 0)
|
||||
return err == nil, err
|
||||
}
|
||||
|
||||
var (
|
||||
emptyFiodgnameArg fiodgnameArg
|
||||
ioctl_FIODNAME = _IOW('f', 120, unsafe.Sizeof(emptyFiodgnameArg))
|
||||
)
|
||||
|
||||
func ptsname(f *os.File) (string, error) {
|
||||
name := make([]byte, _C_SPECNAMELEN)
|
||||
fa := fiodgnameArg{Name: (*byte)(unsafe.Pointer(&name[0])), Len: _C_SPECNAMELEN, Pad_cgo_0: [4]byte{0, 0, 0, 0}}
|
||||
|
||||
err := ioctl(f.Fd(), ioctl_FIODNAME, uintptr(unsafe.Pointer(&fa)))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
for i, c := range name {
|
||||
if c == 0 {
|
||||
s := "/dev/" + string(name[:i])
|
||||
return strings.Replace(s, "ptm", "pts", -1), nil
|
||||
}
|
||||
}
|
||||
return "", errors.New("TIOCPTYGNAME string not NUL-terminated")
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// +build !linux,!darwin,!freebsd
|
||||
// +build !linux,!darwin,!freebsd,!dragonfly
|
||||
|
||||
package pty
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
// +build !windows
|
||||
|
||||
package pty
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
// +build ignore
|
||||
|
||||
package pty
|
||||
|
||||
/*
|
||||
#define _KERNEL
|
||||
#include <sys/conf.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/filio.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
const (
|
||||
_C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */
|
||||
)
|
||||
|
||||
type fiodgnameArg C.struct_fiodname_args
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
// +build !windows
|
||||
|
||||
package pty
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs types_dragonfly.go
|
||||
|
||||
package pty
|
||||
|
||||
const (
|
||||
_C_SPECNAMELEN = 0x3f
|
||||
)
|
||||
|
||||
type fiodgnameArg struct {
|
||||
Name *byte
|
||||
Len uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs types.go
|
||||
|
||||
// +build linux
|
||||
// +build mips mipsle mips64 mips64le
|
||||
|
||||
package pty
|
||||
|
||||
type (
|
||||
_C_int int32
|
||||
_C_uint uint32
|
||||
)
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
package pflag
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// -- boolSlice Value
|
||||
type boolSliceValue struct {
|
||||
value *[]bool
|
||||
changed bool
|
||||
}
|
||||
|
||||
func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue {
|
||||
bsv := new(boolSliceValue)
|
||||
bsv.value = p
|
||||
*bsv.value = val
|
||||
return bsv
|
||||
}
|
||||
|
||||
// Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag.
|
||||
// If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended.
|
||||
func (s *boolSliceValue) Set(val string) error {
|
||||
|
||||
// remove all quote characters
|
||||
rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
|
||||
|
||||
// read flag arguments with CSV parser
|
||||
boolStrSlice, err := readAsCSV(rmQuote.Replace(val))
|
||||
if err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
// parse boolean values into slice
|
||||
out := make([]bool, 0, len(boolStrSlice))
|
||||
for _, boolStr := range boolStrSlice {
|
||||
b, err := strconv.ParseBool(strings.TrimSpace(boolStr))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out = append(out, b)
|
||||
}
|
||||
|
||||
if !s.changed {
|
||||
*s.value = out
|
||||
} else {
|
||||
*s.value = append(*s.value, out...)
|
||||
}
|
||||
|
||||
s.changed = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Type returns a string that uniquely represents this flag's type.
|
||||
func (s *boolSliceValue) Type() string {
|
||||
return "boolSlice"
|
||||
}
|
||||
|
||||
// String defines a "native" format for this boolean slice flag value.
|
||||
func (s *boolSliceValue) String() string {
|
||||
|
||||
boolStrSlice := make([]string, len(*s.value))
|
||||
for i, b := range *s.value {
|
||||
boolStrSlice[i] = strconv.FormatBool(b)
|
||||
}
|
||||
|
||||
out, _ := writeAsCSV(boolStrSlice)
|
||||
|
||||
return "[" + out + "]"
|
||||
}
|
||||
|
||||
func boolSliceConv(val string) (interface{}, error) {
|
||||
val = strings.Trim(val, "[]")
|
||||
// Empty string would cause a slice with one (empty) entry
|
||||
if len(val) == 0 {
|
||||
return []bool{}, nil
|
||||
}
|
||||
ss := strings.Split(val, ",")
|
||||
out := make([]bool, len(ss))
|
||||
for i, t := range ss {
|
||||
var err error
|
||||
out[i], err = strconv.ParseBool(t)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GetBoolSlice returns the []bool value of a flag with the given name.
|
||||
func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
|
||||
val, err := f.getFlagType(name, "boolSlice", boolSliceConv)
|
||||
if err != nil {
|
||||
return []bool{}, err
|
||||
}
|
||||
return val.([]bool), nil
|
||||
}
|
||||
|
||||
// BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string.
|
||||
// The argument p points to a []bool variable in which to store the value of the flag.
|
||||
func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
|
||||
f.VarP(newBoolSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
|
||||
f.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// BoolSliceVar defines a []bool flag with specified name, default value, and usage string.
|
||||
// The argument p points to a []bool variable in which to store the value of the flag.
|
||||
func BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
|
||||
CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
|
||||
CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// BoolSlice defines a []bool flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []bool variable that stores the value of the flag.
|
||||
func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool {
|
||||
p := []bool{}
|
||||
f.BoolSliceVarP(&p, name, "", value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
|
||||
p := []bool{}
|
||||
f.BoolSliceVarP(&p, name, shorthand, value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// BoolSlice defines a []bool flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []bool variable that stores the value of the flag.
|
||||
func BoolSlice(name string, value []bool, usage string) *[]bool {
|
||||
return CommandLine.BoolSliceP(name, "", value, usage)
|
||||
}
|
||||
|
||||
// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
|
||||
return CommandLine.BoolSliceP(name, shorthand, value, usage)
|
||||
}
|
||||
|
|
@ -83,7 +83,9 @@ func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
|
|||
return p
|
||||
}
|
||||
|
||||
// Count like Count only the flag is placed on the CommandLine isntead of a given flag set
|
||||
// Count defines a count flag with specified name, default value, and usage string.
|
||||
// The return value is the address of an int variable that stores the value of the flag.
|
||||
// A count flag will add 1 to its value evey time it is found on the command line
|
||||
func Count(name string, usage string) *int {
|
||||
return CommandLine.CountP(name, "", usage)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ pflag is a drop-in replacement of Go's native flag package. If you import
|
|||
pflag under the name "flag" then all code should continue to function
|
||||
with no changes.
|
||||
|
||||
import flag "github.com/ogier/pflag"
|
||||
import flag "github.com/spf13/pflag"
|
||||
|
||||
There is one exception to this: if you directly instantiate the Flag struct
|
||||
There is one exception to this: if you directly instantiate the Flag struct
|
||||
there is one more field "Shorthand" that you will need to set.
|
||||
Most code never instantiates this struct directly, and instead uses
|
||||
functions such as String(), BoolVar(), and Var(), and is therefore
|
||||
|
|
@ -134,14 +134,21 @@ type FlagSet struct {
|
|||
// a custom error handler.
|
||||
Usage func()
|
||||
|
||||
// SortFlags is used to indicate, if user wants to have sorted flags in
|
||||
// help/usage messages.
|
||||
SortFlags bool
|
||||
|
||||
name string
|
||||
parsed bool
|
||||
actual map[NormalizedName]*Flag
|
||||
orderedActual []*Flag
|
||||
sortedActual []*Flag
|
||||
formal map[NormalizedName]*Flag
|
||||
orderedFormal []*Flag
|
||||
sortedFormal []*Flag
|
||||
shorthands map[byte]*Flag
|
||||
args []string // arguments after flags
|
||||
argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no --
|
||||
exitOnError bool // does the program exit if there's an error?
|
||||
errorHandling ErrorHandling
|
||||
output io.Writer // nil means stderr; use out() accessor
|
||||
interspersed bool // allow interspersed option/non-option args
|
||||
|
|
@ -156,7 +163,7 @@ type Flag struct {
|
|||
Value Value // value as set
|
||||
DefValue string // default value (as text); for usage message
|
||||
Changed bool // If the user set the value (or if left to default)
|
||||
NoOptDefVal string //default value (as text); if the flag is on the command line without any options
|
||||
NoOptDefVal string // default value (as text); if the flag is on the command line without any options
|
||||
Deprecated string // If this flag is deprecated, this string is the new or now thing to use
|
||||
Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text
|
||||
ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use
|
||||
|
|
@ -194,11 +201,13 @@ func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
|
|||
// "--getUrl" which may also be translated to "geturl" and everything will work.
|
||||
func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
|
||||
f.normalizeNameFunc = n
|
||||
for k, v := range f.formal {
|
||||
delete(f.formal, k)
|
||||
nname := f.normalizeFlagName(string(k))
|
||||
f.formal[nname] = v
|
||||
f.sortedFormal = f.sortedFormal[:0]
|
||||
for k, v := range f.orderedFormal {
|
||||
delete(f.formal, NormalizedName(v.Name))
|
||||
nname := f.normalizeFlagName(v.Name)
|
||||
v.Name = string(nname)
|
||||
f.formal[nname] = v
|
||||
f.orderedFormal[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -229,10 +238,25 @@ func (f *FlagSet) SetOutput(output io.Writer) {
|
|||
f.output = output
|
||||
}
|
||||
|
||||
// VisitAll visits the flags in lexicographical order, calling fn for each.
|
||||
// VisitAll visits the flags in lexicographical order or
|
||||
// in primordial order if f.SortFlags is false, calling fn for each.
|
||||
// It visits all flags, even those not set.
|
||||
func (f *FlagSet) VisitAll(fn func(*Flag)) {
|
||||
for _, flag := range sortFlags(f.formal) {
|
||||
if len(f.formal) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
var flags []*Flag
|
||||
if f.SortFlags {
|
||||
if len(f.formal) != len(f.sortedFormal) {
|
||||
f.sortedFormal = sortFlags(f.formal)
|
||||
}
|
||||
flags = f.sortedFormal
|
||||
} else {
|
||||
flags = f.orderedFormal
|
||||
}
|
||||
|
||||
for _, flag := range flags {
|
||||
fn(flag)
|
||||
}
|
||||
}
|
||||
|
|
@ -253,22 +277,39 @@ func (f *FlagSet) HasAvailableFlags() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// VisitAll visits the command-line flags in lexicographical order, calling
|
||||
// fn for each. It visits all flags, even those not set.
|
||||
// VisitAll visits the command-line flags in lexicographical order or
|
||||
// in primordial order if f.SortFlags is false, calling fn for each.
|
||||
// It visits all flags, even those not set.
|
||||
func VisitAll(fn func(*Flag)) {
|
||||
CommandLine.VisitAll(fn)
|
||||
}
|
||||
|
||||
// Visit visits the flags in lexicographical order, calling fn for each.
|
||||
// Visit visits the flags in lexicographical order or
|
||||
// in primordial order if f.SortFlags is false, calling fn for each.
|
||||
// It visits only those flags that have been set.
|
||||
func (f *FlagSet) Visit(fn func(*Flag)) {
|
||||
for _, flag := range sortFlags(f.actual) {
|
||||
if len(f.actual) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
var flags []*Flag
|
||||
if f.SortFlags {
|
||||
if len(f.actual) != len(f.sortedActual) {
|
||||
f.sortedActual = sortFlags(f.actual)
|
||||
}
|
||||
flags = f.sortedActual
|
||||
} else {
|
||||
flags = f.orderedActual
|
||||
}
|
||||
|
||||
for _, flag := range flags {
|
||||
fn(flag)
|
||||
}
|
||||
}
|
||||
|
||||
// Visit visits the command-line flags in lexicographical order, calling fn
|
||||
// for each. It visits only those flags that have been set.
|
||||
// Visit visits the command-line flags in lexicographical order or
|
||||
// in primordial order if f.SortFlags is false, calling fn for each.
|
||||
// It visits only those flags that have been set.
|
||||
func Visit(fn func(*Flag)) {
|
||||
CommandLine.Visit(fn)
|
||||
}
|
||||
|
|
@ -278,6 +319,22 @@ func (f *FlagSet) Lookup(name string) *Flag {
|
|||
return f.lookup(f.normalizeFlagName(name))
|
||||
}
|
||||
|
||||
// ShorthandLookup returns the Flag structure of the short handed flag,
|
||||
// returning nil if none exists.
|
||||
// It panics, if len(name) > 1.
|
||||
func (f *FlagSet) ShorthandLookup(name string) *Flag {
|
||||
if name == "" {
|
||||
return nil
|
||||
}
|
||||
if len(name) > 1 {
|
||||
msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name)
|
||||
fmt.Fprintf(f.out(), msg)
|
||||
panic(msg)
|
||||
}
|
||||
c := name[0]
|
||||
return f.shorthands[c]
|
||||
}
|
||||
|
||||
// lookup returns the Flag structure of the named flag, returning nil if none exists.
|
||||
func (f *FlagSet) lookup(name NormalizedName) *Flag {
|
||||
return f.formal[name]
|
||||
|
|
@ -319,7 +376,7 @@ func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
|
|||
if flag == nil {
|
||||
return fmt.Errorf("flag %q does not exist", name)
|
||||
}
|
||||
if len(usageMessage) == 0 {
|
||||
if usageMessage == "" {
|
||||
return fmt.Errorf("deprecated message for flag %q must be set", name)
|
||||
}
|
||||
flag.Deprecated = usageMessage
|
||||
|
|
@ -334,7 +391,7 @@ func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) erro
|
|||
if flag == nil {
|
||||
return fmt.Errorf("flag %q does not exist", name)
|
||||
}
|
||||
if len(usageMessage) == 0 {
|
||||
if usageMessage == "" {
|
||||
return fmt.Errorf("deprecated message for flag %q must be set", name)
|
||||
}
|
||||
flag.ShorthandDeprecated = usageMessage
|
||||
|
|
@ -358,6 +415,12 @@ func Lookup(name string) *Flag {
|
|||
return CommandLine.Lookup(name)
|
||||
}
|
||||
|
||||
// ShorthandLookup returns the Flag structure of the short handed flag,
|
||||
// returning nil if none exists.
|
||||
func ShorthandLookup(name string) *Flag {
|
||||
return CommandLine.ShorthandLookup(name)
|
||||
}
|
||||
|
||||
// Set sets the value of the named flag.
|
||||
func (f *FlagSet) Set(name, value string) error {
|
||||
normalName := f.normalizeFlagName(name)
|
||||
|
|
@ -365,17 +428,28 @@ func (f *FlagSet) Set(name, value string) error {
|
|||
if !ok {
|
||||
return fmt.Errorf("no such flag -%v", name)
|
||||
}
|
||||
|
||||
err := flag.Value.Set(value)
|
||||
if err != nil {
|
||||
return err
|
||||
var flagName string
|
||||
if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
|
||||
flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name)
|
||||
} else {
|
||||
flagName = fmt.Sprintf("--%s", flag.Name)
|
||||
}
|
||||
return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err)
|
||||
}
|
||||
|
||||
if f.actual == nil {
|
||||
f.actual = make(map[NormalizedName]*Flag)
|
||||
}
|
||||
f.actual[normalName] = flag
|
||||
f.orderedActual = append(f.orderedActual, flag)
|
||||
|
||||
flag.Changed = true
|
||||
if len(flag.Deprecated) > 0 {
|
||||
fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
|
||||
|
||||
if flag.Deprecated != "" {
|
||||
fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
@ -487,31 +561,98 @@ func UnquoteUsage(flag *Flag) (name string, usage string) {
|
|||
return
|
||||
}
|
||||
|
||||
// FlagUsages Returns a string containing the usage information for all flags in
|
||||
// the FlagSet
|
||||
func (f *FlagSet) FlagUsages() string {
|
||||
x := new(bytes.Buffer)
|
||||
// Splits the string `s` on whitespace into an initial substring up to
|
||||
// `i` runes in length and the remainder. Will go `slop` over `i` if
|
||||
// that encompasses the entire string (which allows the caller to
|
||||
// avoid short orphan words on the final line).
|
||||
func wrapN(i, slop int, s string) (string, string) {
|
||||
if i+slop > len(s) {
|
||||
return s, ""
|
||||
}
|
||||
|
||||
w := strings.LastIndexAny(s[:i], " \t")
|
||||
if w <= 0 {
|
||||
return s, ""
|
||||
}
|
||||
|
||||
return s[:w], s[w+1:]
|
||||
}
|
||||
|
||||
// Wraps the string `s` to a maximum width `w` with leading indent
|
||||
// `i`. The first line is not indented (this is assumed to be done by
|
||||
// caller). Pass `w` == 0 to do no wrapping
|
||||
func wrap(i, w int, s string) string {
|
||||
if w == 0 {
|
||||
return s
|
||||
}
|
||||
|
||||
// space between indent i and end of line width w into which
|
||||
// we should wrap the text.
|
||||
wrap := w - i
|
||||
|
||||
var r, l string
|
||||
|
||||
// Not enough space for sensible wrapping. Wrap as a block on
|
||||
// the next line instead.
|
||||
if wrap < 24 {
|
||||
i = 16
|
||||
wrap = w - i
|
||||
r += "\n" + strings.Repeat(" ", i)
|
||||
}
|
||||
// If still not enough space then don't even try to wrap.
|
||||
if wrap < 24 {
|
||||
return s
|
||||
}
|
||||
|
||||
// Try to avoid short orphan words on the final line, by
|
||||
// allowing wrapN to go a bit over if that would fit in the
|
||||
// remainder of the line.
|
||||
slop := 5
|
||||
wrap = wrap - slop
|
||||
|
||||
// Handle first line, which is indented by the caller (or the
|
||||
// special case above)
|
||||
l, s = wrapN(wrap, slop, s)
|
||||
r = r + l
|
||||
|
||||
// Now wrap the rest
|
||||
for s != "" {
|
||||
var t string
|
||||
|
||||
t, s = wrapN(wrap, slop, s)
|
||||
r = r + "\n" + strings.Repeat(" ", i) + t
|
||||
}
|
||||
|
||||
return r
|
||||
|
||||
}
|
||||
|
||||
// FlagUsagesWrapped returns a string containing the usage information
|
||||
// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no
|
||||
// wrapping)
|
||||
func (f *FlagSet) FlagUsagesWrapped(cols int) string {
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
lines := make([]string, 0, len(f.formal))
|
||||
|
||||
maxlen := 0
|
||||
f.VisitAll(func(flag *Flag) {
|
||||
if len(flag.Deprecated) > 0 || flag.Hidden {
|
||||
if flag.Deprecated != "" || flag.Hidden {
|
||||
return
|
||||
}
|
||||
|
||||
line := ""
|
||||
if len(flag.Shorthand) > 0 && len(flag.ShorthandDeprecated) == 0 {
|
||||
if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
|
||||
line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name)
|
||||
} else {
|
||||
line = fmt.Sprintf(" --%s", flag.Name)
|
||||
}
|
||||
|
||||
varname, usage := UnquoteUsage(flag)
|
||||
if len(varname) > 0 {
|
||||
if varname != "" {
|
||||
line += " " + varname
|
||||
}
|
||||
if len(flag.NoOptDefVal) > 0 {
|
||||
if flag.NoOptDefVal != "" {
|
||||
switch flag.Value.Type() {
|
||||
case "string":
|
||||
line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal)
|
||||
|
|
@ -534,7 +675,7 @@ func (f *FlagSet) FlagUsages() string {
|
|||
line += usage
|
||||
if !flag.defaultIsZeroValue() {
|
||||
if flag.Value.Type() == "string" {
|
||||
line += fmt.Sprintf(" (default \"%s\")", flag.DefValue)
|
||||
line += fmt.Sprintf(" (default %q)", flag.DefValue)
|
||||
} else {
|
||||
line += fmt.Sprintf(" (default %s)", flag.DefValue)
|
||||
}
|
||||
|
|
@ -546,10 +687,17 @@ func (f *FlagSet) FlagUsages() string {
|
|||
for _, line := range lines {
|
||||
sidx := strings.Index(line, "\x00")
|
||||
spacing := strings.Repeat(" ", maxlen-sidx)
|
||||
fmt.Fprintln(x, line[:sidx], spacing, line[sidx+1:])
|
||||
// maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx
|
||||
fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:]))
|
||||
}
|
||||
|
||||
return x.String()
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// FlagUsages returns a string containing the usage information for all flags in
|
||||
// the FlagSet
|
||||
func (f *FlagSet) FlagUsages() string {
|
||||
return f.FlagUsagesWrapped(0)
|
||||
}
|
||||
|
||||
// PrintDefaults prints to standard error the default values of all defined command-line flags.
|
||||
|
|
@ -635,16 +783,15 @@ func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
|
|||
|
||||
// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
|
||||
_ = f.VarPF(value, name, shorthand, usage)
|
||||
f.VarPF(value, name, shorthand, usage)
|
||||
}
|
||||
|
||||
// AddFlag will add the flag to the FlagSet
|
||||
func (f *FlagSet) AddFlag(flag *Flag) {
|
||||
// Call normalizeFlagName function only once
|
||||
normalizedFlagName := f.normalizeFlagName(flag.Name)
|
||||
|
||||
_, alreadythere := f.formal[normalizedFlagName]
|
||||
if alreadythere {
|
||||
_, alreadyThere := f.formal[normalizedFlagName]
|
||||
if alreadyThere {
|
||||
msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
|
||||
fmt.Fprintln(f.out(), msg)
|
||||
panic(msg) // Happens only if flags are declared with identical names
|
||||
|
|
@ -655,28 +802,31 @@ func (f *FlagSet) AddFlag(flag *Flag) {
|
|||
|
||||
flag.Name = string(normalizedFlagName)
|
||||
f.formal[normalizedFlagName] = flag
|
||||
f.orderedFormal = append(f.orderedFormal, flag)
|
||||
|
||||
if len(flag.Shorthand) == 0 {
|
||||
if flag.Shorthand == "" {
|
||||
return
|
||||
}
|
||||
if len(flag.Shorthand) > 1 {
|
||||
fmt.Fprintf(f.out(), "%s shorthand more than ASCII character: %s\n", f.name, flag.Shorthand)
|
||||
panic("shorthand is more than one character")
|
||||
msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand)
|
||||
fmt.Fprintf(f.out(), msg)
|
||||
panic(msg)
|
||||
}
|
||||
if f.shorthands == nil {
|
||||
f.shorthands = make(map[byte]*Flag)
|
||||
}
|
||||
c := flag.Shorthand[0]
|
||||
old, alreadythere := f.shorthands[c]
|
||||
if alreadythere {
|
||||
fmt.Fprintf(f.out(), "%s shorthand reused: %q for %s already used for %s\n", f.name, c, flag.Name, old.Name)
|
||||
panic("shorthand redefinition")
|
||||
used, alreadyThere := f.shorthands[c]
|
||||
if alreadyThere {
|
||||
msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name)
|
||||
fmt.Fprintf(f.out(), msg)
|
||||
panic(msg)
|
||||
}
|
||||
f.shorthands[c] = flag
|
||||
}
|
||||
|
||||
// AddFlagSet adds one FlagSet to another. If a flag is already present in f
|
||||
// the flag from newSet will be ignored
|
||||
// the flag from newSet will be ignored.
|
||||
func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
|
||||
if newSet == nil {
|
||||
return
|
||||
|
|
@ -724,45 +874,18 @@ func (f *FlagSet) usage() {
|
|||
}
|
||||
}
|
||||
|
||||
func (f *FlagSet) setFlag(flag *Flag, value string, origArg string) error {
|
||||
if err := flag.Value.Set(value); err != nil {
|
||||
return f.failf("invalid argument %q for %s: %v", value, origArg, err)
|
||||
}
|
||||
// mark as visited for Visit()
|
||||
if f.actual == nil {
|
||||
f.actual = make(map[NormalizedName]*Flag)
|
||||
}
|
||||
f.actual[f.normalizeFlagName(flag.Name)] = flag
|
||||
flag.Changed = true
|
||||
if len(flag.Deprecated) > 0 {
|
||||
fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
|
||||
}
|
||||
if len(flag.ShorthandDeprecated) > 0 && containsShorthand(origArg, flag.Shorthand) {
|
||||
fmt.Fprintf(os.Stderr, "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func containsShorthand(arg, shorthand string) bool {
|
||||
// filter out flags --<flag_name>
|
||||
if strings.HasPrefix(arg, "-") {
|
||||
return false
|
||||
}
|
||||
arg = strings.SplitN(arg, "=", 2)[0]
|
||||
return strings.Contains(arg, shorthand)
|
||||
}
|
||||
|
||||
func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) {
|
||||
func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) {
|
||||
a = args
|
||||
name := s[2:]
|
||||
if len(name) == 0 || name[0] == '-' || name[0] == '=' {
|
||||
err = f.failf("bad flag syntax: %s", s)
|
||||
return
|
||||
}
|
||||
|
||||
split := strings.SplitN(name, "=", 2)
|
||||
name = split[0]
|
||||
flag, alreadythere := f.formal[f.normalizeFlagName(name)]
|
||||
if !alreadythere {
|
||||
flag, exists := f.formal[f.normalizeFlagName(name)]
|
||||
if !exists {
|
||||
if name == "help" { // special case for nice help message.
|
||||
f.usage()
|
||||
return a, ErrHelp
|
||||
|
|
@ -770,11 +893,12 @@ func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error)
|
|||
err = f.failf("unknown flag: --%s", name)
|
||||
return
|
||||
}
|
||||
|
||||
var value string
|
||||
if len(split) == 2 {
|
||||
// '--flag=arg'
|
||||
value = split[1]
|
||||
} else if len(flag.NoOptDefVal) > 0 {
|
||||
} else if flag.NoOptDefVal != "" {
|
||||
// '--flag' (arg was optional)
|
||||
value = flag.NoOptDefVal
|
||||
} else if len(a) > 0 {
|
||||
|
|
@ -786,55 +910,68 @@ func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error)
|
|||
err = f.failf("flag needs an argument: %s", s)
|
||||
return
|
||||
}
|
||||
err = f.setFlag(flag, value, s)
|
||||
|
||||
err = fn(flag, value)
|
||||
return
|
||||
}
|
||||
|
||||
func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShorts string, outArgs []string, err error) {
|
||||
func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
|
||||
if strings.HasPrefix(shorthands, "test.") {
|
||||
return
|
||||
}
|
||||
|
||||
outArgs = args
|
||||
outShorts = shorthands[1:]
|
||||
c := shorthands[0]
|
||||
|
||||
flag, alreadythere := f.shorthands[c]
|
||||
if !alreadythere {
|
||||
flag, exists := f.shorthands[c]
|
||||
if !exists {
|
||||
if c == 'h' { // special case for nice help message.
|
||||
f.usage()
|
||||
err = ErrHelp
|
||||
return
|
||||
}
|
||||
//TODO continue on error
|
||||
err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
|
||||
return
|
||||
}
|
||||
|
||||
var value string
|
||||
if len(shorthands) > 2 && shorthands[1] == '=' {
|
||||
// '-f=arg'
|
||||
value = shorthands[2:]
|
||||
outShorts = ""
|
||||
} else if len(flag.NoOptDefVal) > 0 {
|
||||
} else if flag.NoOptDefVal != "" {
|
||||
// '-f' (arg was optional)
|
||||
value = flag.NoOptDefVal
|
||||
} else if len(shorthands) > 1 {
|
||||
// '-farg'
|
||||
value = shorthands[1:]
|
||||
outShorts = ""
|
||||
} else if len(args) > 0 {
|
||||
// '-f arg'
|
||||
value = args[0]
|
||||
outArgs = args[1:]
|
||||
} else {
|
||||
// '-f' (arg was required)
|
||||
err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
|
||||
return
|
||||
}
|
||||
err = f.setFlag(flag, value, shorthands)
|
||||
|
||||
if flag.ShorthandDeprecated != "" {
|
||||
fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated)
|
||||
}
|
||||
|
||||
err = fn(flag, value)
|
||||
return
|
||||
}
|
||||
|
||||
func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error) {
|
||||
func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) {
|
||||
a = args
|
||||
shorthands := s[1:]
|
||||
|
||||
// "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv").
|
||||
for len(shorthands) > 0 {
|
||||
shorthands, a, err = f.parseSingleShortArg(shorthands, args)
|
||||
shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
@ -843,7 +980,7 @@ func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error)
|
|||
return
|
||||
}
|
||||
|
||||
func (f *FlagSet) parseArgs(args []string) (err error) {
|
||||
func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
|
||||
for len(args) > 0 {
|
||||
s := args[0]
|
||||
args = args[1:]
|
||||
|
|
@ -863,9 +1000,9 @@ func (f *FlagSet) parseArgs(args []string) (err error) {
|
|||
f.args = append(f.args, args...)
|
||||
break
|
||||
}
|
||||
args, err = f.parseLongArg(s, args)
|
||||
args, err = f.parseLongArg(s, args, fn)
|
||||
} else {
|
||||
args, err = f.parseShortArg(s, args)
|
||||
args, err = f.parseShortArg(s, args, fn)
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
|
|
@ -880,8 +1017,43 @@ func (f *FlagSet) parseArgs(args []string) (err error) {
|
|||
// The return value will be ErrHelp if -help was set but not defined.
|
||||
func (f *FlagSet) Parse(arguments []string) error {
|
||||
f.parsed = true
|
||||
|
||||
if len(arguments) < 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
err := f.parseArgs(arguments)
|
||||
|
||||
set := func(flag *Flag, value string) error {
|
||||
return f.Set(flag.Name, value)
|
||||
}
|
||||
|
||||
err := f.parseArgs(arguments, set)
|
||||
if err != nil {
|
||||
switch f.errorHandling {
|
||||
case ContinueOnError:
|
||||
return err
|
||||
case ExitOnError:
|
||||
os.Exit(2)
|
||||
case PanicOnError:
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type parseFunc func(flag *Flag, value string) error
|
||||
|
||||
// ParseAll parses flag definitions from the argument list, which should not
|
||||
// include the command name. The arguments for fn are flag and value. Must be
|
||||
// called after all flags in the FlagSet are defined and before flags are
|
||||
// accessed by the program. The return value will be ErrHelp if -help was set
|
||||
// but not defined.
|
||||
func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error {
|
||||
f.parsed = true
|
||||
f.args = make([]string, 0, len(arguments))
|
||||
|
||||
err := f.parseArgs(arguments, fn)
|
||||
if err != nil {
|
||||
switch f.errorHandling {
|
||||
case ContinueOnError:
|
||||
|
|
@ -907,6 +1079,14 @@ func Parse() {
|
|||
CommandLine.Parse(os.Args[1:])
|
||||
}
|
||||
|
||||
// ParseAll parses the command-line flags from os.Args[1:] and called fn for each.
|
||||
// The arguments for fn are flag and value. Must be called after all flags are
|
||||
// defined and before flags are accessed by the program.
|
||||
func ParseAll(fn func(flag *Flag, value string) error) {
|
||||
// Ignore errors; CommandLine is set for ExitOnError.
|
||||
CommandLine.ParseAll(os.Args[1:], fn)
|
||||
}
|
||||
|
||||
// SetInterspersed sets whether to support interspersed option/non-option arguments.
|
||||
func SetInterspersed(interspersed bool) {
|
||||
CommandLine.SetInterspersed(interspersed)
|
||||
|
|
@ -920,14 +1100,15 @@ func Parsed() bool {
|
|||
// CommandLine is the default set of command-line flags, parsed from os.Args.
|
||||
var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
|
||||
|
||||
// NewFlagSet returns a new, empty flag set with the specified name and
|
||||
// error handling property.
|
||||
// NewFlagSet returns a new, empty flag set with the specified name,
|
||||
// error handling property and SortFlags set to true.
|
||||
func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
|
||||
f := &FlagSet{
|
||||
name: name,
|
||||
errorHandling: errorHandling,
|
||||
argsLenAtDash: -1,
|
||||
interspersed: true,
|
||||
SortFlags: true,
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,10 @@ package pflag
|
|||
|
||||
import (
|
||||
goflag "flag"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
// flagValueWrapper implements pflag.Value around a flag.Value. The main
|
||||
// difference here is the addition of the Type method that returns a string
|
||||
// name of the type. As this is generally unknown, we approximate that with
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
var _ = strings.TrimSpace
|
||||
|
||||
// -- net.IP value
|
||||
type ipValue net.IP
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,148 @@
|
|||
package pflag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// -- ipSlice Value
|
||||
type ipSliceValue struct {
|
||||
value *[]net.IP
|
||||
changed bool
|
||||
}
|
||||
|
||||
func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue {
|
||||
ipsv := new(ipSliceValue)
|
||||
ipsv.value = p
|
||||
*ipsv.value = val
|
||||
return ipsv
|
||||
}
|
||||
|
||||
// Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag.
|
||||
// If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended.
|
||||
func (s *ipSliceValue) Set(val string) error {
|
||||
|
||||
// remove all quote characters
|
||||
rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
|
||||
|
||||
// read flag arguments with CSV parser
|
||||
ipStrSlice, err := readAsCSV(rmQuote.Replace(val))
|
||||
if err != nil && err != io.EOF {
|
||||
return err
|
||||
}
|
||||
|
||||
// parse ip values into slice
|
||||
out := make([]net.IP, 0, len(ipStrSlice))
|
||||
for _, ipStr := range ipStrSlice {
|
||||
ip := net.ParseIP(strings.TrimSpace(ipStr))
|
||||
if ip == nil {
|
||||
return fmt.Errorf("invalid string being converted to IP address: %s", ipStr)
|
||||
}
|
||||
out = append(out, ip)
|
||||
}
|
||||
|
||||
if !s.changed {
|
||||
*s.value = out
|
||||
} else {
|
||||
*s.value = append(*s.value, out...)
|
||||
}
|
||||
|
||||
s.changed = true
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Type returns a string that uniquely represents this flag's type.
|
||||
func (s *ipSliceValue) Type() string {
|
||||
return "ipSlice"
|
||||
}
|
||||
|
||||
// String defines a "native" format for this net.IP slice flag value.
|
||||
func (s *ipSliceValue) String() string {
|
||||
|
||||
ipStrSlice := make([]string, len(*s.value))
|
||||
for i, ip := range *s.value {
|
||||
ipStrSlice[i] = ip.String()
|
||||
}
|
||||
|
||||
out, _ := writeAsCSV(ipStrSlice)
|
||||
|
||||
return "[" + out + "]"
|
||||
}
|
||||
|
||||
func ipSliceConv(val string) (interface{}, error) {
|
||||
val = strings.Trim(val, "[]")
|
||||
// Emtpy string would cause a slice with one (empty) entry
|
||||
if len(val) == 0 {
|
||||
return []net.IP{}, nil
|
||||
}
|
||||
ss := strings.Split(val, ",")
|
||||
out := make([]net.IP, len(ss))
|
||||
for i, sval := range ss {
|
||||
ip := net.ParseIP(strings.TrimSpace(sval))
|
||||
if ip == nil {
|
||||
return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
|
||||
}
|
||||
out[i] = ip
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GetIPSlice returns the []net.IP value of a flag with the given name
|
||||
func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) {
|
||||
val, err := f.getFlagType(name, "ipSlice", ipSliceConv)
|
||||
if err != nil {
|
||||
return []net.IP{}, err
|
||||
}
|
||||
return val.([]net.IP), nil
|
||||
}
|
||||
|
||||
// IPSliceVar defines a ipSlice flag with specified name, default value, and usage string.
|
||||
// The argument p points to a []net.IP variable in which to store the value of the flag.
|
||||
func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
|
||||
f.VarP(newIPSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
|
||||
f.VarP(newIPSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// IPSliceVar defines a []net.IP flag with specified name, default value, and usage string.
|
||||
// The argument p points to a []net.IP variable in which to store the value of the flag.
|
||||
func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
|
||||
CommandLine.VarP(newIPSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
|
||||
CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []net.IP variable that stores the value of that flag.
|
||||
func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP {
|
||||
p := []net.IP{}
|
||||
f.IPSliceVarP(&p, name, "", value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
|
||||
p := []net.IP{}
|
||||
f.IPSliceVarP(&p, name, shorthand, value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []net.IP variable that stores the value of the flag.
|
||||
func IPSlice(name string, value []net.IP, usage string) *[]net.IP {
|
||||
return CommandLine.IPSliceP(name, "", value, usage)
|
||||
}
|
||||
|
||||
// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
|
||||
return CommandLine.IPSliceP(name, shorthand, value, usage)
|
||||
}
|
||||
|
|
@ -27,8 +27,6 @@ func (*ipNetValue) Type() string {
|
|||
return "ipNet"
|
||||
}
|
||||
|
||||
var _ = strings.TrimSpace
|
||||
|
||||
func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
|
||||
*p = val
|
||||
return (*ipNetValue)(p)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
package pflag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var _ = fmt.Fprint
|
||||
|
||||
// -- stringArray Value
|
||||
type stringArrayValue struct {
|
||||
value *[]string
|
||||
|
|
|
|||
|
|
@ -3,12 +3,9 @@ package pflag
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var _ = fmt.Fprint
|
||||
|
||||
// -- stringSlice Value
|
||||
type stringSliceValue struct {
|
||||
value *[]string
|
||||
|
|
@ -39,7 +36,7 @@ func writeAsCSV(vals []string) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
w.Flush()
|
||||
return strings.TrimSuffix(b.String(), fmt.Sprintln()), nil
|
||||
return strings.TrimSuffix(b.String(), "\n"), nil
|
||||
}
|
||||
|
||||
func (s *stringSliceValue) Set(val string) error {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,126 @@
|
|||
package pflag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// -- uintSlice Value
|
||||
type uintSliceValue struct {
|
||||
value *[]uint
|
||||
changed bool
|
||||
}
|
||||
|
||||
func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
|
||||
uisv := new(uintSliceValue)
|
||||
uisv.value = p
|
||||
*uisv.value = val
|
||||
return uisv
|
||||
}
|
||||
|
||||
func (s *uintSliceValue) Set(val string) error {
|
||||
ss := strings.Split(val, ",")
|
||||
out := make([]uint, len(ss))
|
||||
for i, d := range ss {
|
||||
u, err := strconv.ParseUint(d, 10, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out[i] = uint(u)
|
||||
}
|
||||
if !s.changed {
|
||||
*s.value = out
|
||||
} else {
|
||||
*s.value = append(*s.value, out...)
|
||||
}
|
||||
s.changed = true
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *uintSliceValue) Type() string {
|
||||
return "uintSlice"
|
||||
}
|
||||
|
||||
func (s *uintSliceValue) String() string {
|
||||
out := make([]string, len(*s.value))
|
||||
for i, d := range *s.value {
|
||||
out[i] = fmt.Sprintf("%d", d)
|
||||
}
|
||||
return "[" + strings.Join(out, ",") + "]"
|
||||
}
|
||||
|
||||
func uintSliceConv(val string) (interface{}, error) {
|
||||
val = strings.Trim(val, "[]")
|
||||
// Empty string would cause a slice with one (empty) entry
|
||||
if len(val) == 0 {
|
||||
return []uint{}, nil
|
||||
}
|
||||
ss := strings.Split(val, ",")
|
||||
out := make([]uint, len(ss))
|
||||
for i, d := range ss {
|
||||
u, err := strconv.ParseUint(d, 10, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out[i] = uint(u)
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GetUintSlice returns the []uint value of a flag with the given name.
|
||||
func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
|
||||
val, err := f.getFlagType(name, "uintSlice", uintSliceConv)
|
||||
if err != nil {
|
||||
return []uint{}, err
|
||||
}
|
||||
return val.([]uint), nil
|
||||
}
|
||||
|
||||
// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
|
||||
// The argument p points to a []uint variable in which to store the value of the flag.
|
||||
func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) {
|
||||
f.VarP(newUintSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
|
||||
f.VarP(newUintSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
|
||||
// The argument p points to a uint[] variable in which to store the value of the flag.
|
||||
func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
|
||||
CommandLine.VarP(newUintSliceValue(value, p), name, "", usage)
|
||||
}
|
||||
|
||||
// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
|
||||
func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
|
||||
CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage)
|
||||
}
|
||||
|
||||
// UintSlice defines a []uint flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []uint variable that stores the value of the flag.
|
||||
func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint {
|
||||
p := []uint{}
|
||||
f.UintSliceVarP(&p, name, "", value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
|
||||
p := []uint{}
|
||||
f.UintSliceVarP(&p, name, shorthand, value, usage)
|
||||
return &p
|
||||
}
|
||||
|
||||
// UintSlice defines a []uint flag with specified name, default value, and usage string.
|
||||
// The return value is the address of a []uint variable that stores the value of the flag.
|
||||
func UintSlice(name string, value []uint, usage string) *[]uint {
|
||||
return CommandLine.UintSliceP(name, "", value, usage)
|
||||
}
|
||||
|
||||
// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
|
||||
func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
|
||||
return CommandLine.UintSliceP(name, shorthand, value, usage)
|
||||
}
|
||||
|
|
@ -28,8 +28,7 @@ import (
|
|||
// See https://cloud.google.com/appengine/docs/flexible/custom-runtimes#health_check_requests
|
||||
// for details on how to do your own health checking.
|
||||
//
|
||||
// On App Engine Standard it ensures the server has started and is prepared to
|
||||
// receive requests.
|
||||
// Main is not yet supported on App Engine Standard.
|
||||
//
|
||||
// Main never returns.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import (
|
|||
|
||||
const (
|
||||
apiPath = "/rpc_http"
|
||||
defaultTicketSuffix = "/default.20150612t184001.0"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -61,9 +60,6 @@ var (
|
|||
Dial: limitDial,
|
||||
},
|
||||
}
|
||||
|
||||
defaultTicketOnce sync.Once
|
||||
defaultTicket string
|
||||
)
|
||||
|
||||
func apiURL() *url.URL {
|
||||
|
|
@ -227,8 +223,6 @@ type context struct {
|
|||
|
||||
var contextKey = "holds a *context"
|
||||
|
||||
// fromContext returns the App Engine context or nil if ctx is not
|
||||
// derived from an App Engine context.
|
||||
func fromContext(ctx netcontext.Context) *context {
|
||||
c, _ := ctx.Value(&contextKey).(*context)
|
||||
return c
|
||||
|
|
@ -272,24 +266,6 @@ func WithContext(parent netcontext.Context, req *http.Request) netcontext.Contex
|
|||
return withContext(parent, c)
|
||||
}
|
||||
|
||||
// DefaultTicket returns a ticket used for background context or dev_appserver.
|
||||
func DefaultTicket() string {
|
||||
defaultTicketOnce.Do(func() {
|
||||
if IsDevAppServer() {
|
||||
defaultTicket = "testapp" + defaultTicketSuffix
|
||||
return
|
||||
}
|
||||
appID := partitionlessAppID()
|
||||
escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1)
|
||||
majVersion := VersionID(nil)
|
||||
if i := strings.Index(majVersion, "."); i > 0 {
|
||||
majVersion = majVersion[:i]
|
||||
}
|
||||
defaultTicket = fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID())
|
||||
})
|
||||
return defaultTicket
|
||||
}
|
||||
|
||||
func BackgroundContext() netcontext.Context {
|
||||
ctxs.Lock()
|
||||
defer ctxs.Unlock()
|
||||
|
|
@ -299,7 +275,13 @@ func BackgroundContext() netcontext.Context {
|
|||
}
|
||||
|
||||
// Compute background security ticket.
|
||||
ticket := DefaultTicket()
|
||||
appID := partitionlessAppID()
|
||||
escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1)
|
||||
majVersion := VersionID(nil)
|
||||
if i := strings.Index(majVersion, "."); i > 0 {
|
||||
majVersion = majVersion[:i]
|
||||
}
|
||||
ticket := fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID())
|
||||
|
||||
ctxs.bg = &context{
|
||||
req: &http.Request{
|
||||
|
|
@ -470,7 +452,7 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message)
|
|||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
// Give a good error message rather than a panic lower down.
|
||||
return errNotAppEngineContext
|
||||
return errors.New("not an App Engine context")
|
||||
}
|
||||
|
||||
// Apply transaction modifications if we're in a transaction.
|
||||
|
|
@ -493,16 +475,6 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message)
|
|||
}
|
||||
|
||||
ticket := c.req.Header.Get(ticketHeader)
|
||||
// Use a test ticket under test environment.
|
||||
if ticket == "" {
|
||||
if appid := ctx.Value(&appIDOverrideKey); appid != nil {
|
||||
ticket = appid.(string) + defaultTicketSuffix
|
||||
}
|
||||
}
|
||||
// Fall back to use background ticket when the request ticket is not available in Flex or dev_appserver.
|
||||
if ticket == "" {
|
||||
ticket = DefaultTicket()
|
||||
}
|
||||
req := &remotepb.Request{
|
||||
ServiceName: &service,
|
||||
Method: &method,
|
||||
|
|
@ -578,9 +550,6 @@ var logLevelName = map[int64]string{
|
|||
}
|
||||
|
||||
func logf(c *context, level int64, format string, args ...interface{}) {
|
||||
if c == nil {
|
||||
panic("not an App Engine context")
|
||||
}
|
||||
s := fmt.Sprintf(format, args...)
|
||||
s = strings.TrimRight(s, "\n") // Remove any trailing newline characters.
|
||||
c.addLogLine(&logpb.UserAppLogLine{
|
||||
|
|
|
|||
|
|
@ -22,20 +22,14 @@ import (
|
|||
|
||||
var contextKey = "holds an appengine.Context"
|
||||
|
||||
// fromContext returns the App Engine context or nil if ctx is not
|
||||
// derived from an App Engine context.
|
||||
func fromContext(ctx netcontext.Context) appengine.Context {
|
||||
c, _ := ctx.Value(&contextKey).(appengine.Context)
|
||||
return c
|
||||
}
|
||||
|
||||
// This is only for classic App Engine adapters.
|
||||
func ClassicContextFromContext(ctx netcontext.Context) (appengine.Context, error) {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
return nil, errNotAppEngineContext
|
||||
}
|
||||
return c, nil
|
||||
func ClassicContextFromContext(ctx netcontext.Context) appengine.Context {
|
||||
return fromContext(ctx)
|
||||
}
|
||||
|
||||
func withContext(parent netcontext.Context, c appengine.Context) netcontext.Context {
|
||||
|
|
@ -104,7 +98,7 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message)
|
|||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
// Give a good error message rather than a panic lower down.
|
||||
return errNotAppEngineContext
|
||||
return errors.New("not an App Engine context")
|
||||
}
|
||||
|
||||
// Apply transaction modifications if we're in a transaction.
|
||||
|
|
|
|||
|
|
@ -5,15 +5,10 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
netcontext "golang.org/x/net/context"
|
||||
)
|
||||
|
||||
var errNotAppEngineContext = errors.New("not an App Engine context")
|
||||
|
||||
type CallOverrideFunc func(ctx netcontext.Context, service, method string, in, out proto.Message) error
|
||||
|
||||
var callOverrideKey = "holds []CallOverrideFunc"
|
||||
|
|
@ -82,42 +77,10 @@ func Logf(ctx netcontext.Context, level int64, format string, args ...interface{
|
|||
f(level, format, args...)
|
||||
return
|
||||
}
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
logf(c, level, format, args...)
|
||||
logf(fromContext(ctx), level, format, args...)
|
||||
}
|
||||
|
||||
// NamespacedContext wraps a Context to support namespaces.
|
||||
func NamespacedContext(ctx netcontext.Context, namespace string) netcontext.Context {
|
||||
return withNamespace(ctx, namespace)
|
||||
}
|
||||
|
||||
// SetTestEnv sets the env variables for testing background ticket in Flex.
|
||||
func SetTestEnv() func() {
|
||||
var environ = []struct {
|
||||
key, value string
|
||||
}{
|
||||
{"GAE_LONG_APP_ID", "my-app-id"},
|
||||
{"GAE_MINOR_VERSION", "067924799508853122"},
|
||||
{"GAE_MODULE_INSTANCE", "0"},
|
||||
{"GAE_MODULE_NAME", "default"},
|
||||
{"GAE_MODULE_VERSION", "20150612t184001"},
|
||||
}
|
||||
|
||||
for _, v := range environ {
|
||||
old := os.Getenv(v.key)
|
||||
os.Setenv(v.key, v.value)
|
||||
v.value = old
|
||||
}
|
||||
return func() { // Restore old environment after the test completes.
|
||||
for _, v := range environ {
|
||||
if v.value == "" {
|
||||
os.Unsetenv(v.key)
|
||||
continue
|
||||
}
|
||||
os.Setenv(v.key, v.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,45 +13,15 @@ import (
|
|||
)
|
||||
|
||||
func DefaultVersionHostname(ctx netcontext.Context) string {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
return appengine.DefaultVersionHostname(c)
|
||||
return appengine.DefaultVersionHostname(fromContext(ctx))
|
||||
}
|
||||
|
||||
func RequestID(ctx netcontext.Context) string { return appengine.RequestID(fromContext(ctx)) }
|
||||
func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() }
|
||||
func ServerSoftware() string { return appengine.ServerSoftware() }
|
||||
func ModuleName(ctx netcontext.Context) string { return appengine.ModuleName(fromContext(ctx)) }
|
||||
func VersionID(ctx netcontext.Context) string { return appengine.VersionID(fromContext(ctx)) }
|
||||
func InstanceID() string { return appengine.InstanceID() }
|
||||
func IsDevAppServer() bool { return appengine.IsDevAppServer() }
|
||||
|
||||
func RequestID(ctx netcontext.Context) string {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
return appengine.RequestID(c)
|
||||
}
|
||||
|
||||
func ModuleName(ctx netcontext.Context) string {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
return appengine.ModuleName(c)
|
||||
}
|
||||
func VersionID(ctx netcontext.Context) string {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
return appengine.VersionID(c)
|
||||
}
|
||||
|
||||
func fullyQualifiedAppID(ctx netcontext.Context) string {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
panic(errNotAppEngineContext)
|
||||
}
|
||||
return c.FullyQualifiedAppID()
|
||||
}
|
||||
func fullyQualifiedAppID(ctx netcontext.Context) string { return fromContext(ctx).FullyQualifiedAppID() }
|
||||
|
|
|
|||
|
|
@ -23,11 +23,7 @@ const (
|
|||
)
|
||||
|
||||
func ctxHeaders(ctx netcontext.Context) http.Header {
|
||||
c := fromContext(ctx)
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.Request().Header
|
||||
return fromContext(ctx).Request().Header
|
||||
}
|
||||
|
||||
func DefaultVersionHostname(ctx netcontext.Context) string {
|
||||
|
|
|
|||
|
|
@ -22,11 +22,7 @@ func Main() {
|
|||
port = s
|
||||
}
|
||||
|
||||
host := ""
|
||||
if IsDevAppServer() {
|
||||
host = "127.0.0.1"
|
||||
}
|
||||
if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil {
|
||||
if err := http.ListenAndServe(":"+port, http.HandlerFunc(handleHTTP)); err != nil {
|
||||
log.Fatalf("http.ListenAndServe: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
143
vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go
generated
vendored
Normal file
143
vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go
generated
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: google/rpc/status.proto
|
||||
|
||||
/*
|
||||
Package status is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google/rpc/status.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Status
|
||||
*/
|
||||
package status
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
import google_protobuf "github.com/golang/protobuf/ptypes/any"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// The `Status` type defines a logical error model that is suitable for different
|
||||
// programming environments, including REST APIs and RPC APIs. It is used by
|
||||
// [gRPC](https://github.com/grpc). The error model is designed to be:
|
||||
//
|
||||
// - Simple to use and understand for most users
|
||||
// - Flexible enough to meet unexpected needs
|
||||
//
|
||||
// # Overview
|
||||
//
|
||||
// The `Status` message contains three pieces of data: error code, error message,
|
||||
// and error details. The error code should be an enum value of
|
||||
// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The
|
||||
// error message should be a developer-facing English message that helps
|
||||
// developers *understand* and *resolve* the error. If a localized user-facing
|
||||
// error message is needed, put the localized message in the error details or
|
||||
// localize it in the client. The optional error details may contain arbitrary
|
||||
// information about the error. There is a predefined set of error detail types
|
||||
// in the package `google.rpc` which can be used for common error conditions.
|
||||
//
|
||||
// # Language mapping
|
||||
//
|
||||
// The `Status` message is the logical representation of the error model, but it
|
||||
// is not necessarily the actual wire format. When the `Status` message is
|
||||
// exposed in different client libraries and different wire protocols, it can be
|
||||
// mapped differently. For example, it will likely be mapped to some exceptions
|
||||
// in Java, but more likely mapped to some error codes in C.
|
||||
//
|
||||
// # Other uses
|
||||
//
|
||||
// The error model and the `Status` message can be used in a variety of
|
||||
// environments, either with or without APIs, to provide a
|
||||
// consistent developer experience across different environments.
|
||||
//
|
||||
// Example uses of this error model include:
|
||||
//
|
||||
// - Partial errors. If a service needs to return partial errors to the client,
|
||||
// it may embed the `Status` in the normal response to indicate the partial
|
||||
// errors.
|
||||
//
|
||||
// - Workflow errors. A typical workflow has multiple steps. Each step may
|
||||
// have a `Status` message for error reporting purpose.
|
||||
//
|
||||
// - Batch operations. If a client uses batch request and batch response, the
|
||||
// `Status` message should be used directly inside batch response, one for
|
||||
// each error sub-response.
|
||||
//
|
||||
// - Asynchronous operations. If an API call embeds asynchronous operation
|
||||
// results in its response, the status of those operations should be
|
||||
// represented directly using the `Status` message.
|
||||
//
|
||||
// - Logging. If some API errors are stored in logs, the message `Status` could
|
||||
// be used directly after any stripping needed for security/privacy reasons.
|
||||
type Status struct {
|
||||
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
|
||||
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
|
||||
// A developer-facing error message, which should be in English. Any
|
||||
// user-facing error message should be localized and sent in the
|
||||
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
|
||||
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
|
||||
// A list of messages that carry the error details. There will be a
|
||||
// common set of message types for APIs to use.
|
||||
Details []*google_protobuf.Any `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Status) Reset() { *m = Status{} }
|
||||
func (m *Status) String() string { return proto.CompactTextString(m) }
|
||||
func (*Status) ProtoMessage() {}
|
||||
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *Status) GetCode() int32 {
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Status) GetMessage() string {
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Status) GetDetails() []*google_protobuf.Any {
|
||||
if m != nil {
|
||||
return m.Details
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Status)(nil), "google.rpc.Status")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("google/rpc/status.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 209 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xcf, 0xcf, 0x4f,
|
||||
0xcf, 0x49, 0xd5, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28,
|
||||
0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe8, 0x15, 0x15, 0x24, 0x4b, 0x49, 0x42, 0x15, 0x81,
|
||||
0x65, 0x92, 0x4a, 0xd3, 0xf4, 0x13, 0xf3, 0x2a, 0x21, 0xca, 0x94, 0xd2, 0xb8, 0xd8, 0x82, 0xc1,
|
||||
0xda, 0x84, 0x84, 0xb8, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0x58, 0x83,
|
||||
0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x09, 0x26, 0x05,
|
||||
0x46, 0x0d, 0xce, 0x20, 0x18, 0x57, 0x48, 0x8f, 0x8b, 0x3d, 0x25, 0xb5, 0x24, 0x31, 0x33, 0xa7,
|
||||
0x58, 0x82, 0x59, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x44, 0x0f, 0x6a, 0x21, 0xcc, 0x12, 0x3d, 0xc7,
|
||||
0xbc, 0xca, 0x20, 0x98, 0x22, 0xa7, 0x38, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d, 0x84, 0xa3, 0x9c,
|
||||
0xb8, 0x21, 0xf6, 0x06, 0x80, 0x94, 0x07, 0x30, 0x46, 0x99, 0x43, 0xa5, 0xd2, 0xf3, 0x73, 0x12,
|
||||
0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0xc0, 0x86, 0xe9, 0x43, 0xa4, 0x12,
|
||||
0x0b, 0x32, 0x8b, 0x91, 0xfc, 0x69, 0x0d, 0xa1, 0x16, 0x31, 0x31, 0x07, 0x05, 0x38, 0x27, 0xb1,
|
||||
0x81, 0x55, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x53, 0xf0, 0x7c, 0x10, 0x01, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
|
@ -35,6 +35,7 @@ package grpc
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
|
@ -60,6 +61,10 @@ type BalancerConfig struct {
|
|||
// use to dial to a remote load balancer server. The Balancer implementations
|
||||
// can ignore this if it does not need to talk to another party securely.
|
||||
DialCreds credentials.TransportCredentials
|
||||
// Dialer is the custom dialer the Balancer implementation can use to dial
|
||||
// to a remote load balancer server. The Balancer implementations
|
||||
// can ignore this if it doesn't need to talk to remote balancer.
|
||||
Dialer func(context.Context, string) (net.Conn, error)
|
||||
}
|
||||
|
||||
// BalancerGetOptions configures a Get call.
|
||||
|
|
@ -385,6 +390,9 @@ func (rr *roundRobin) Notify() <-chan []Address {
|
|||
func (rr *roundRobin) Close() error {
|
||||
rr.mu.Lock()
|
||||
defer rr.mu.Unlock()
|
||||
if rr.done {
|
||||
return errBalancerClosed
|
||||
}
|
||||
rr.done = true
|
||||
if rr.w != nil {
|
||||
rr.w.Close()
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import (
|
|||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/peer"
|
||||
"google.golang.org/grpc/stats"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/grpc/transport"
|
||||
)
|
||||
|
||||
|
|
@ -72,14 +73,17 @@ func recvResponse(ctx context.Context, dopts dialOptions, t transport.ClientTran
|
|||
}
|
||||
}
|
||||
for {
|
||||
if err = recv(p, dopts.codec, stream, dopts.dc, reply, dopts.maxMsgSize, inPayload); err != nil {
|
||||
if c.maxReceiveMessageSize == nil {
|
||||
return Errorf(codes.Internal, "callInfo maxReceiveMessageSize field uninitialized(nil)")
|
||||
}
|
||||
if err = recv(p, dopts.codec, stream, dopts.dc, reply, *c.maxReceiveMessageSize, inPayload); err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
if inPayload != nil && err == io.EOF && stream.StatusCode() == codes.OK {
|
||||
if inPayload != nil && err == io.EOF && stream.Status().Code() == codes.OK {
|
||||
// TODO in the current implementation, inTrailer may be handled before inPayload in some cases.
|
||||
// Fix the order if necessary.
|
||||
dopts.copts.StatsHandler.HandleRPC(ctx, inPayload)
|
||||
|
|
@ -92,11 +96,7 @@ func recvResponse(ctx context.Context, dopts dialOptions, t transport.ClientTran
|
|||
}
|
||||
|
||||
// sendRequest writes out various information of an RPC such as Context and Message.
|
||||
func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor, callHdr *transport.CallHdr, t transport.ClientTransport, args interface{}, opts *transport.Options) (_ *transport.Stream, err error) {
|
||||
stream, err := t.NewStream(ctx, callHdr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor, c *callInfo, callHdr *transport.CallHdr, stream *transport.Stream, t transport.ClientTransport, args interface{}, opts *transport.Options) (err error) {
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// If err is connection error, t will be closed, no need to close stream here.
|
||||
|
|
@ -119,7 +119,13 @@ func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor,
|
|||
}
|
||||
outBuf, err := encode(dopts.codec, args, compressor, cbuf, outPayload)
|
||||
if err != nil {
|
||||
return nil, Errorf(codes.Internal, "grpc: %v", err)
|
||||
return err
|
||||
}
|
||||
if c.maxSendMessageSize == nil {
|
||||
return Errorf(codes.Internal, "callInfo maxSendMessageSize field uninitialized(nil)")
|
||||
}
|
||||
if len(outBuf) > *c.maxSendMessageSize {
|
||||
return Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(outBuf), *c.maxSendMessageSize)
|
||||
}
|
||||
err = t.Write(stream, outBuf, opts)
|
||||
if err == nil && outPayload != nil {
|
||||
|
|
@ -130,10 +136,10 @@ func sendRequest(ctx context.Context, dopts dialOptions, compressor Compressor,
|
|||
// does not exist.) so that t.Write could get io.EOF from wait(...). Leave the following
|
||||
// recvResponse to get the final status.
|
||||
if err != nil && err != io.EOF {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
// Sent successfully.
|
||||
return stream, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
// Invoke sends the RPC request on the wire and returns after response is received.
|
||||
|
|
@ -148,14 +154,18 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
|
||||
func invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) (e error) {
|
||||
c := defaultCallInfo
|
||||
if mc, ok := cc.getMethodConfig(method); ok {
|
||||
c.failFast = !mc.WaitForReady
|
||||
if mc.Timeout > 0 {
|
||||
mc := cc.GetMethodConfig(method)
|
||||
if mc.WaitForReady != nil {
|
||||
c.failFast = !*mc.WaitForReady
|
||||
}
|
||||
|
||||
if mc.Timeout != nil && *mc.Timeout >= 0 {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, mc.Timeout)
|
||||
ctx, cancel = context.WithTimeout(ctx, *mc.Timeout)
|
||||
defer cancel()
|
||||
}
|
||||
}
|
||||
|
||||
opts = append(cc.dopts.callOptions, opts...)
|
||||
for _, o := range opts {
|
||||
if err := o.before(&c); err != nil {
|
||||
return toRPCErr(err)
|
||||
|
|
@ -166,6 +176,10 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
o.after(&c)
|
||||
}
|
||||
}()
|
||||
|
||||
c.maxSendMessageSize = getMaxSize(mc.MaxReqSize, c.maxSendMessageSize, defaultClientMaxSendMessageSize)
|
||||
c.maxReceiveMessageSize = getMaxSize(mc.MaxRespSize, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize)
|
||||
|
||||
if EnableTracing {
|
||||
c.traceInfo.tr = trace.New("grpc.Sent."+methodFamily(method), method)
|
||||
defer c.traceInfo.tr.Finish()
|
||||
|
|
@ -182,26 +196,25 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
}
|
||||
}()
|
||||
}
|
||||
ctx = newContextWithRPCInfo(ctx)
|
||||
sh := cc.dopts.copts.StatsHandler
|
||||
if sh != nil {
|
||||
ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method})
|
||||
ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: c.failFast})
|
||||
begin := &stats.Begin{
|
||||
Client: true,
|
||||
BeginTime: time.Now(),
|
||||
FailFast: c.failFast,
|
||||
}
|
||||
sh.HandleRPC(ctx, begin)
|
||||
}
|
||||
defer func() {
|
||||
if sh != nil {
|
||||
end := &stats.End{
|
||||
Client: true,
|
||||
EndTime: time.Now(),
|
||||
Error: e,
|
||||
}
|
||||
sh.HandleRPC(ctx, end)
|
||||
}
|
||||
}()
|
||||
}
|
||||
topts := &transport.Options{
|
||||
Last: true,
|
||||
Delay: false,
|
||||
|
|
@ -223,6 +236,9 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
if cc.dopts.cp != nil {
|
||||
callHdr.SendCompress = cc.dopts.cp.Type()
|
||||
}
|
||||
if c.creds != nil {
|
||||
callHdr.Creds = c.creds
|
||||
}
|
||||
|
||||
gopts := BalancerGetOptions{
|
||||
BlockingWait: !c.failFast,
|
||||
|
|
@ -230,7 +246,7 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
t, put, err = cc.getTransport(ctx, gopts)
|
||||
if err != nil {
|
||||
// TODO(zhaoq): Probably revisit the error handling.
|
||||
if _, ok := err.(*rpcError); ok {
|
||||
if _, ok := status.FromError(err); ok {
|
||||
return err
|
||||
}
|
||||
if err == errConnClosing || err == errConnUnavailable {
|
||||
|
|
@ -245,19 +261,35 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
if c.traceInfo.tr != nil {
|
||||
c.traceInfo.tr.LazyLog(&payload{sent: true, msg: args}, true)
|
||||
}
|
||||
stream, err = sendRequest(ctx, cc.dopts, cc.dopts.cp, callHdr, t, args, topts)
|
||||
stream, err = t.NewStream(ctx, callHdr)
|
||||
if err != nil {
|
||||
if put != nil {
|
||||
if _, ok := err.(transport.ConnectionError); ok {
|
||||
// If error is connection error, transport was sending data on wire,
|
||||
// and we are not sure if anything has been sent on wire.
|
||||
// If error is not connection error, we are sure nothing has been sent.
|
||||
updateRPCInfoInContext(ctx, rpcInfo{bytesSent: true, bytesReceived: false})
|
||||
}
|
||||
put()
|
||||
}
|
||||
if _, ok := err.(transport.ConnectionError); (ok || err == transport.ErrStreamDrain) && !c.failFast {
|
||||
continue
|
||||
}
|
||||
return toRPCErr(err)
|
||||
}
|
||||
err = sendRequest(ctx, cc.dopts, cc.dopts.cp, &c, callHdr, stream, t, args, topts)
|
||||
if err != nil {
|
||||
if put != nil {
|
||||
updateRPCInfoInContext(ctx, rpcInfo{
|
||||
bytesSent: stream.BytesSent(),
|
||||
bytesReceived: stream.BytesReceived(),
|
||||
})
|
||||
put()
|
||||
put = nil
|
||||
}
|
||||
// Retry a non-failfast RPC when
|
||||
// i) there is a connection error; or
|
||||
// ii) the server started to drain before this RPC was initiated.
|
||||
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
|
||||
if c.failFast {
|
||||
return toRPCErr(err)
|
||||
}
|
||||
if _, ok := err.(transport.ConnectionError); (ok || err == transport.ErrStreamDrain) && !c.failFast {
|
||||
continue
|
||||
}
|
||||
return toRPCErr(err)
|
||||
|
|
@ -265,13 +297,13 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
err = recvResponse(ctx, cc.dopts, t, &c, stream, reply)
|
||||
if err != nil {
|
||||
if put != nil {
|
||||
updateRPCInfoInContext(ctx, rpcInfo{
|
||||
bytesSent: stream.BytesSent(),
|
||||
bytesReceived: stream.BytesReceived(),
|
||||
})
|
||||
put()
|
||||
put = nil
|
||||
}
|
||||
if _, ok := err.(transport.ConnectionError); ok || err == transport.ErrStreamDrain {
|
||||
if c.failFast {
|
||||
return toRPCErr(err)
|
||||
}
|
||||
if _, ok := err.(transport.ConnectionError); (ok || err == transport.ErrStreamDrain) && !c.failFast {
|
||||
continue
|
||||
}
|
||||
return toRPCErr(err)
|
||||
|
|
@ -281,9 +313,12 @@ func invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli
|
|||
}
|
||||
t.CloseStream(stream, nil)
|
||||
if put != nil {
|
||||
updateRPCInfoInContext(ctx, rpcInfo{
|
||||
bytesSent: stream.BytesSent(),
|
||||
bytesReceived: stream.BytesReceived(),
|
||||
})
|
||||
put()
|
||||
put = nil
|
||||
}
|
||||
return Errorf(stream.StatusCode(), "%s", stream.StatusDesc())
|
||||
return stream.Status().Err()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ package grpc
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
|
|
@ -57,8 +56,7 @@ var (
|
|||
ErrClientConnClosing = errors.New("grpc: the client connection is closing")
|
||||
// ErrClientConnTimeout indicates that the ClientConn cannot establish the
|
||||
// underlying connections within the specified timeout.
|
||||
// DEPRECATED: Please use context.DeadlineExceeded instead. This error will be
|
||||
// removed in Q1 2017.
|
||||
// DEPRECATED: Please use context.DeadlineExceeded instead.
|
||||
ErrClientConnTimeout = errors.New("grpc: timed out when dialing")
|
||||
|
||||
// errNoTransportSecurity indicates that there is no transport security
|
||||
|
|
@ -80,7 +78,8 @@ var (
|
|||
errConnClosing = errors.New("grpc: the connection is closing")
|
||||
// errConnUnavailable indicates that the connection is unavailable.
|
||||
errConnUnavailable = errors.New("grpc: the connection is unavailable")
|
||||
errNoAddr = errors.New("grpc: there is no address available to dial")
|
||||
// errBalancerClosed indicates that the balancer is closed.
|
||||
errBalancerClosed = errors.New("grpc: balancer is closed")
|
||||
// minimum time to give a connection to complete
|
||||
minConnectTimeout = 20 * time.Second
|
||||
)
|
||||
|
|
@ -100,18 +99,42 @@ type dialOptions struct {
|
|||
timeout time.Duration
|
||||
scChan <-chan ServiceConfig
|
||||
copts transport.ConnectOptions
|
||||
maxMsgSize int
|
||||
callOptions []CallOption
|
||||
}
|
||||
|
||||
const defaultClientMaxMsgSize = math.MaxInt32
|
||||
const (
|
||||
defaultClientMaxReceiveMessageSize = 1024 * 1024 * 4
|
||||
defaultClientMaxSendMessageSize = 1024 * 1024 * 4
|
||||
)
|
||||
|
||||
// DialOption configures how we set up the connection.
|
||||
type DialOption func(*dialOptions)
|
||||
|
||||
// WithMaxMsgSize returns a DialOption which sets the maximum message size the client can receive.
|
||||
func WithMaxMsgSize(s int) DialOption {
|
||||
// WithInitialWindowSize returns a DialOption which sets the value for initial window size on a stream.
|
||||
// The lower bound for window size is 64K and any value smaller than that will be ignored.
|
||||
func WithInitialWindowSize(s int32) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
o.maxMsgSize = s
|
||||
o.copts.InitialWindowSize = s
|
||||
}
|
||||
}
|
||||
|
||||
// WithInitialConnWindowSize returns a DialOption which sets the value for initial window size on a connection.
|
||||
// The lower bound for window size is 64K and any value smaller than that will be ignored.
|
||||
func WithInitialConnWindowSize(s int32) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
o.copts.InitialConnWindowSize = s
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxMsgSize returns a DialOption which sets the maximum message size the client can receive. Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead.
|
||||
func WithMaxMsgSize(s int) DialOption {
|
||||
return WithDefaultCallOptions(MaxCallRecvMsgSize(s))
|
||||
}
|
||||
|
||||
// WithDefaultCallOptions returns a DialOption which sets the default CallOptions for calls over the connection.
|
||||
func WithDefaultCallOptions(cos ...CallOption) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
o.callOptions = append(o.callOptions, cos...)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +229,7 @@ func WithTransportCredentials(creds credentials.TransportCredentials) DialOption
|
|||
}
|
||||
|
||||
// WithPerRPCCredentials returns a DialOption which sets
|
||||
// credentials which will place auth state on each outbound RPC.
|
||||
// credentials and places auth state on each outbound RPC.
|
||||
func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption {
|
||||
return func(o *dialOptions) {
|
||||
o.copts.PerRPCCredentials = append(o.copts.PerRPCCredentials, creds)
|
||||
|
|
@ -243,7 +266,7 @@ func WithStatsHandler(h stats.Handler) DialOption {
|
|||
}
|
||||
}
|
||||
|
||||
// FailOnNonTempDialError returns a DialOption that specified if gRPC fails on non-temporary dial errors.
|
||||
// FailOnNonTempDialError returns a DialOption that specifies if gRPC fails on non-temporary dial errors.
|
||||
// If f is true, and dialer returns a non-temporary error, gRPC will fail the connection to the network
|
||||
// address and won't try to reconnect.
|
||||
// The default value of FailOnNonTempDialError is false.
|
||||
|
|
@ -297,22 +320,29 @@ func Dial(target string, opts ...DialOption) (*ClientConn, error) {
|
|||
}
|
||||
|
||||
// DialContext creates a client connection to the given target. ctx can be used to
|
||||
// cancel or expire the pending connecting. Once this function returns, the
|
||||
// cancel or expire the pending connection. Once this function returns, the
|
||||
// cancellation and expiration of ctx will be noop. Users should call ClientConn.Close
|
||||
// to terminate all the pending operations after this function returns.
|
||||
// This is the EXPERIMENTAL API.
|
||||
func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) {
|
||||
cc := &ClientConn{
|
||||
target: target,
|
||||
conns: make(map[Address]*addrConn),
|
||||
}
|
||||
cc.ctx, cc.cancel = context.WithCancel(context.Background())
|
||||
cc.dopts.maxMsgSize = defaultClientMaxMsgSize
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(&cc.dopts)
|
||||
}
|
||||
cc.mkp = cc.dopts.copts.KeepaliveParams
|
||||
|
||||
if cc.dopts.copts.Dialer == nil {
|
||||
cc.dopts.copts.Dialer = newProxyDialer(
|
||||
func(ctx context.Context, addr string) (net.Conn, error) {
|
||||
return dialContext(ctx, "tcp", addr)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
grpcUA := "grpc-go/" + Version
|
||||
if cc.dopts.copts.UserAgent != "" {
|
||||
cc.dopts.copts.UserAgent += " " + grpcUA
|
||||
} else {
|
||||
|
|
@ -337,15 +367,16 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
|
|||
}
|
||||
}()
|
||||
|
||||
scSet := false
|
||||
if cc.dopts.scChan != nil {
|
||||
// Wait for the initial service config.
|
||||
// Try to get an initial service config.
|
||||
select {
|
||||
case sc, ok := <-cc.dopts.scChan:
|
||||
if ok {
|
||||
cc.sc = sc
|
||||
scSet = true
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
default:
|
||||
}
|
||||
}
|
||||
// Set defaults.
|
||||
|
|
@ -361,53 +392,44 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
|
|||
} else if cc.dopts.insecure && cc.dopts.copts.Authority != "" {
|
||||
cc.authority = cc.dopts.copts.Authority
|
||||
} else {
|
||||
colonPos := strings.LastIndex(target, ":")
|
||||
if colonPos == -1 {
|
||||
colonPos = len(target)
|
||||
cc.authority = target
|
||||
}
|
||||
cc.authority = target[:colonPos]
|
||||
}
|
||||
var ok bool
|
||||
waitC := make(chan error, 1)
|
||||
go func() {
|
||||
var addrs []Address
|
||||
defer close(waitC)
|
||||
if cc.dopts.balancer == nil && cc.sc.LB != nil {
|
||||
cc.dopts.balancer = cc.sc.LB
|
||||
}
|
||||
if cc.dopts.balancer == nil {
|
||||
// Connect to target directly if balancer is nil.
|
||||
addrs = append(addrs, Address{Addr: target})
|
||||
} else {
|
||||
if cc.dopts.balancer != nil {
|
||||
var credsClone credentials.TransportCredentials
|
||||
if creds != nil {
|
||||
credsClone = creds.Clone()
|
||||
}
|
||||
config := BalancerConfig{
|
||||
DialCreds: credsClone,
|
||||
Dialer: cc.dopts.copts.Dialer,
|
||||
}
|
||||
if err := cc.dopts.balancer.Start(target, config); err != nil {
|
||||
waitC <- err
|
||||
return
|
||||
}
|
||||
ch := cc.dopts.balancer.Notify()
|
||||
if ch == nil {
|
||||
// There is no name resolver installed.
|
||||
addrs = append(addrs, Address{Addr: target})
|
||||
if ch != nil {
|
||||
if cc.dopts.block {
|
||||
doneChan := make(chan struct{})
|
||||
go cc.lbWatcher(doneChan)
|
||||
<-doneChan
|
||||
} else {
|
||||
addrs, ok = <-ch
|
||||
if !ok || len(addrs) == 0 {
|
||||
waitC <- errNoAddr
|
||||
go cc.lbWatcher(nil)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, a := range addrs {
|
||||
if err := cc.resetAddrConn(a, false, nil); err != nil {
|
||||
// No balancer, or no resolver within the balancer. Connect directly.
|
||||
if err := cc.resetAddrConn(Address{Addr: target}, cc.dopts.block, nil); err != nil {
|
||||
waitC <- err
|
||||
return
|
||||
}
|
||||
}
|
||||
close(waitC)
|
||||
}()
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
|
|
@ -417,16 +439,21 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// If balancer is nil or balancer.Notify() is nil, ok will be false here.
|
||||
// The lbWatcher goroutine will not be created.
|
||||
if cc.dopts.scChan != nil && !scSet {
|
||||
// Blocking wait for the initial service config.
|
||||
select {
|
||||
case sc, ok := <-cc.dopts.scChan:
|
||||
if ok {
|
||||
go cc.lbWatcher()
|
||||
cc.sc = sc
|
||||
}
|
||||
case <-ctx.Done():
|
||||
return nil, ctx.Err()
|
||||
}
|
||||
}
|
||||
|
||||
if cc.dopts.scChan != nil {
|
||||
go cc.scWatcher()
|
||||
}
|
||||
|
||||
return cc, nil
|
||||
}
|
||||
|
||||
|
|
@ -475,9 +502,14 @@ type ClientConn struct {
|
|||
mu sync.RWMutex
|
||||
sc ServiceConfig
|
||||
conns map[Address]*addrConn
|
||||
// Keepalive parameter can be udated if a GoAway is received.
|
||||
mkp keepalive.ClientParameters
|
||||
}
|
||||
|
||||
func (cc *ClientConn) lbWatcher() {
|
||||
// lbWatcher watches the Notify channel of the balancer in cc and manages
|
||||
// connections accordingly. If doneChan is not nil, it is closed after the
|
||||
// first successfull connection is made.
|
||||
func (cc *ClientConn) lbWatcher(doneChan chan struct{}) {
|
||||
for addrs := range cc.dopts.balancer.Notify() {
|
||||
var (
|
||||
add []Address // Addresses need to setup connections.
|
||||
|
|
@ -504,7 +536,15 @@ func (cc *ClientConn) lbWatcher() {
|
|||
}
|
||||
cc.mu.Unlock()
|
||||
for _, a := range add {
|
||||
cc.resetAddrConn(a, true, nil)
|
||||
if doneChan != nil {
|
||||
err := cc.resetAddrConn(a, true, nil)
|
||||
if err == nil {
|
||||
close(doneChan)
|
||||
doneChan = nil
|
||||
}
|
||||
} else {
|
||||
cc.resetAddrConn(a, false, nil)
|
||||
}
|
||||
}
|
||||
for _, c := range del {
|
||||
c.tearDown(errConnDrain)
|
||||
|
|
@ -533,12 +573,15 @@ func (cc *ClientConn) scWatcher() {
|
|||
// resetAddrConn creates an addrConn for addr and adds it to cc.conns.
|
||||
// If there is an old addrConn for addr, it will be torn down, using tearDownErr as the reason.
|
||||
// If tearDownErr is nil, errConnDrain will be used instead.
|
||||
func (cc *ClientConn) resetAddrConn(addr Address, skipWait bool, tearDownErr error) error {
|
||||
func (cc *ClientConn) resetAddrConn(addr Address, block bool, tearDownErr error) error {
|
||||
ac := &addrConn{
|
||||
cc: cc,
|
||||
addr: addr,
|
||||
dopts: cc.dopts,
|
||||
}
|
||||
cc.mu.RLock()
|
||||
ac.dopts.copts.KeepaliveParams = cc.mkp
|
||||
cc.mu.RUnlock()
|
||||
ac.ctx, ac.cancel = context.WithCancel(cc.ctx)
|
||||
ac.stateCV = sync.NewCond(&ac.mu)
|
||||
if EnableTracing {
|
||||
|
|
@ -583,8 +626,7 @@ func (cc *ClientConn) resetAddrConn(addr Address, skipWait bool, tearDownErr err
|
|||
stale.tearDown(tearDownErr)
|
||||
}
|
||||
}
|
||||
// skipWait may overwrite the decision in ac.dopts.block.
|
||||
if ac.dopts.block && !skipWait {
|
||||
if block {
|
||||
if err := ac.resetTransport(false); err != nil {
|
||||
if err != errConnClosing {
|
||||
// Tear down ac and delete it from cc.conns.
|
||||
|
|
@ -617,12 +659,23 @@ func (cc *ClientConn) resetAddrConn(addr Address, skipWait bool, tearDownErr err
|
|||
return nil
|
||||
}
|
||||
|
||||
// TODO: Avoid the locking here.
|
||||
func (cc *ClientConn) getMethodConfig(method string) (m MethodConfig, ok bool) {
|
||||
// GetMethodConfig gets the method config of the input method.
|
||||
// If there's an exact match for input method (i.e. /service/method), we return
|
||||
// the corresponding MethodConfig.
|
||||
// If there isn't an exact match for the input method, we look for the default config
|
||||
// under the service (i.e /service/). If there is a default MethodConfig for
|
||||
// the serivce, we return it.
|
||||
// Otherwise, we return an empty MethodConfig.
|
||||
func (cc *ClientConn) GetMethodConfig(method string) MethodConfig {
|
||||
// TODO: Avoid the locking here.
|
||||
cc.mu.RLock()
|
||||
defer cc.mu.RUnlock()
|
||||
m, ok = cc.sc.Methods[method]
|
||||
return
|
||||
m, ok := cc.sc.Methods[method]
|
||||
if !ok {
|
||||
i := strings.LastIndex(method, "/")
|
||||
m, _ = cc.sc.Methods[method[:i+1]]
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func (cc *ClientConn) getTransport(ctx context.Context, opts BalancerGetOptions) (transport.ClientTransport, func(), error) {
|
||||
|
|
@ -663,6 +716,7 @@ func (cc *ClientConn) getTransport(ctx context.Context, opts BalancerGetOptions)
|
|||
}
|
||||
if !ok {
|
||||
if put != nil {
|
||||
updateRPCInfoInContext(ctx, rpcInfo{bytesSent: false, bytesReceived: false})
|
||||
put()
|
||||
}
|
||||
return nil, nil, errConnClosing
|
||||
|
|
@ -670,6 +724,7 @@ func (cc *ClientConn) getTransport(ctx context.Context, opts BalancerGetOptions)
|
|||
t, err := ac.wait(ctx, cc.dopts.balancer != nil, !opts.BlockingWait)
|
||||
if err != nil {
|
||||
if put != nil {
|
||||
updateRPCInfoInContext(ctx, rpcInfo{bytesSent: false, bytesReceived: false})
|
||||
put()
|
||||
}
|
||||
return nil, nil, err
|
||||
|
|
@ -721,6 +776,20 @@ type addrConn struct {
|
|||
tearDownErr error
|
||||
}
|
||||
|
||||
// adjustParams updates parameters used to create transports upon
|
||||
// receiving a GoAway.
|
||||
func (ac *addrConn) adjustParams(r transport.GoAwayReason) {
|
||||
switch r {
|
||||
case transport.TooManyPings:
|
||||
v := 2 * ac.dopts.copts.KeepaliveParams.Time
|
||||
ac.cc.mu.Lock()
|
||||
if v > ac.cc.mkp.Time {
|
||||
ac.cc.mkp.Time = v
|
||||
}
|
||||
ac.cc.mu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
// printf records an event in ac's event log, unless ac has been closed.
|
||||
// REQUIRES ac.mu is held.
|
||||
func (ac *addrConn) printf(format string, a ...interface{}) {
|
||||
|
|
@ -829,11 +898,14 @@ func (ac *addrConn) resetTransport(closeTransport bool) error {
|
|||
}
|
||||
ac.mu.Unlock()
|
||||
closeTransport = false
|
||||
timer := time.NewTimer(sleepTime - time.Since(connectTime))
|
||||
select {
|
||||
case <-time.After(sleepTime - time.Since(connectTime)):
|
||||
case <-timer.C:
|
||||
case <-ac.ctx.Done():
|
||||
timer.Stop()
|
||||
return ac.ctx.Err()
|
||||
}
|
||||
timer.Stop()
|
||||
continue
|
||||
}
|
||||
ac.mu.Lock()
|
||||
|
|
@ -877,6 +949,7 @@ func (ac *addrConn) transportMonitor() {
|
|||
}
|
||||
return
|
||||
case <-t.GoAway():
|
||||
ac.adjustParams(t.GetGoAwayReason())
|
||||
// If GoAway happens without any network I/O error, ac is closed without shutting down the
|
||||
// underlying transport (the transport will be closed when all the pending RPCs finished or
|
||||
// failed.).
|
||||
|
|
@ -885,9 +958,9 @@ func (ac *addrConn) transportMonitor() {
|
|||
// In both cases, a new ac is created.
|
||||
select {
|
||||
case <-t.Error():
|
||||
ac.cc.resetAddrConn(ac.addr, true, errNetworkIO)
|
||||
ac.cc.resetAddrConn(ac.addr, false, errNetworkIO)
|
||||
default:
|
||||
ac.cc.resetAddrConn(ac.addr, true, errConnDrain)
|
||||
ac.cc.resetAddrConn(ac.addr, false, errConnDrain)
|
||||
}
|
||||
return
|
||||
case <-t.Error():
|
||||
|
|
@ -896,7 +969,8 @@ func (ac *addrConn) transportMonitor() {
|
|||
t.Close()
|
||||
return
|
||||
case <-t.GoAway():
|
||||
ac.cc.resetAddrConn(ac.addr, true, errNetworkIO)
|
||||
ac.adjustParams(t.GetGoAwayReason())
|
||||
ac.cc.resetAddrConn(ac.addr, false, errNetworkIO)
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue