Adds scheme to the node status

This commit is contained in:
Yuce Tekol 2017-10-24 01:37:41 +03:00
parent c9cb92c96b
commit 197e05b04a
No known key found for this signature in database
GPG key ID: CB59E46D2FB90573
4 changed files with 972 additions and 374 deletions

File diff suppressed because it is too large Load diff

View file

@ -116,6 +116,7 @@ message NodeStatus {
string Host = 1;
string State = 2;
repeated Index Indexes = 3;
string Scheme = 4;
}
message ClusterStatus {

View file

@ -1,6 +1,5 @@
// Code generated by protoc-gen-gogo.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: public.proto
// DO NOT EDIT!
/*
Package internal is a generated protocol buffer package.
@ -28,6 +27,8 @@ import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import encoding_binary "encoding/binary"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
@ -51,6 +52,13 @@ func (m *Bitmap) String() string { return proto.CompactTextString(m)
func (*Bitmap) ProtoMessage() {}
func (*Bitmap) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{0} }
func (m *Bitmap) GetBits() []uint64 {
if m != nil {
return m.Bits
}
return nil
}
func (m *Bitmap) GetAttrs() []*Attr {
if m != nil {
return m.Attrs
@ -68,6 +76,20 @@ func (m *Pair) String() string { return proto.CompactTextString(m) }
func (*Pair) ProtoMessage() {}
func (*Pair) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{1} }
func (m *Pair) GetKey() uint64 {
if m != nil {
return m.Key
}
return 0
}
func (m *Pair) GetCount() uint64 {
if m != nil {
return m.Count
}
return 0
}
type SumCount struct {
Sum int64 `protobuf:"varint,1,opt,name=Sum,proto3" json:"Sum,omitempty"`
Count int64 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"`
@ -78,6 +100,20 @@ func (m *SumCount) String() string { return proto.CompactTextString(m
func (*SumCount) ProtoMessage() {}
func (*SumCount) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{2} }
func (m *SumCount) GetSum() int64 {
if m != nil {
return m.Sum
}
return 0
}
func (m *SumCount) GetCount() int64 {
if m != nil {
return m.Count
}
return 0
}
type Bit struct {
RowID uint64 `protobuf:"varint,1,opt,name=RowID,proto3" json:"RowID,omitempty"`
ColumnID uint64 `protobuf:"varint,2,opt,name=ColumnID,proto3" json:"ColumnID,omitempty"`
@ -89,6 +125,27 @@ func (m *Bit) String() string { return proto.CompactTextString(m) }
func (*Bit) ProtoMessage() {}
func (*Bit) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{3} }
func (m *Bit) GetRowID() uint64 {
if m != nil {
return m.RowID
}
return 0
}
func (m *Bit) GetColumnID() uint64 {
if m != nil {
return m.ColumnID
}
return 0
}
func (m *Bit) GetTimestamp() int64 {
if m != nil {
return m.Timestamp
}
return 0
}
type ColumnAttrSet struct {
ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Attrs []*Attr `protobuf:"bytes,2,rep,name=Attrs" json:"Attrs,omitempty"`
@ -99,6 +156,13 @@ func (m *ColumnAttrSet) String() string { return proto.CompactTextStr
func (*ColumnAttrSet) ProtoMessage() {}
func (*ColumnAttrSet) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{4} }
func (m *ColumnAttrSet) GetID() uint64 {
if m != nil {
return m.ID
}
return 0
}
func (m *ColumnAttrSet) GetAttrs() []*Attr {
if m != nil {
return m.Attrs
@ -120,6 +184,48 @@ func (m *Attr) String() string { return proto.CompactTextString(m) }
func (*Attr) ProtoMessage() {}
func (*Attr) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{5} }
func (m *Attr) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *Attr) GetType() uint64 {
if m != nil {
return m.Type
}
return 0
}
func (m *Attr) GetStringValue() string {
if m != nil {
return m.StringValue
}
return ""
}
func (m *Attr) GetIntValue() int64 {
if m != nil {
return m.IntValue
}
return 0
}
func (m *Attr) GetBoolValue() bool {
if m != nil {
return m.BoolValue
}
return false
}
func (m *Attr) GetFloatValue() float64 {
if m != nil {
return m.FloatValue
}
return 0
}
type AttrMap struct {
Attrs []*Attr `protobuf:"bytes,1,rep,name=Attrs" json:"Attrs,omitempty"`
}
@ -150,6 +256,48 @@ func (m *QueryRequest) String() string { return proto.CompactTextStri
func (*QueryRequest) ProtoMessage() {}
func (*QueryRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{7} }
func (m *QueryRequest) GetQuery() string {
if m != nil {
return m.Query
}
return ""
}
func (m *QueryRequest) GetSlices() []uint64 {
if m != nil {
return m.Slices
}
return nil
}
func (m *QueryRequest) GetColumnAttrs() bool {
if m != nil {
return m.ColumnAttrs
}
return false
}
func (m *QueryRequest) GetRemote() bool {
if m != nil {
return m.Remote
}
return false
}
func (m *QueryRequest) GetExcludeAttrs() bool {
if m != nil {
return m.ExcludeAttrs
}
return false
}
func (m *QueryRequest) GetExcludeBits() bool {
if m != nil {
return m.ExcludeBits
}
return false
}
type QueryResponse struct {
Err string `protobuf:"bytes,1,opt,name=Err,proto3" json:"Err,omitempty"`
Results []*QueryResult `protobuf:"bytes,2,rep,name=Results" json:"Results,omitempty"`
@ -161,6 +309,13 @@ func (m *QueryResponse) String() string { return proto.CompactTextStr
func (*QueryResponse) ProtoMessage() {}
func (*QueryResponse) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{8} }
func (m *QueryResponse) GetErr() string {
if m != nil {
return m.Err
}
return ""
}
func (m *QueryResponse) GetResults() []*QueryResult {
if m != nil {
return m.Results
@ -195,6 +350,13 @@ func (m *QueryResult) GetBitmap() *Bitmap {
return nil
}
func (m *QueryResult) GetN() uint64 {
if m != nil {
return m.N
}
return 0
}
func (m *QueryResult) GetPairs() []*Pair {
if m != nil {
return m.Pairs
@ -209,6 +371,13 @@ func (m *QueryResult) GetSumCount() *SumCount {
return nil
}
func (m *QueryResult) GetChanged() bool {
if m != nil {
return m.Changed
}
return false
}
type ImportRequest struct {
Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"`
Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"`
@ -223,6 +392,48 @@ func (m *ImportRequest) String() string { return proto.CompactTextStr
func (*ImportRequest) ProtoMessage() {}
func (*ImportRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{10} }
func (m *ImportRequest) GetIndex() string {
if m != nil {
return m.Index
}
return ""
}
func (m *ImportRequest) GetFrame() string {
if m != nil {
return m.Frame
}
return ""
}
func (m *ImportRequest) GetSlice() uint64 {
if m != nil {
return m.Slice
}
return 0
}
func (m *ImportRequest) GetRowIDs() []uint64 {
if m != nil {
return m.RowIDs
}
return nil
}
func (m *ImportRequest) GetColumnIDs() []uint64 {
if m != nil {
return m.ColumnIDs
}
return nil
}
func (m *ImportRequest) GetTimestamps() []int64 {
if m != nil {
return m.Timestamps
}
return nil
}
type ImportValueRequest struct {
Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"`
Frame string `protobuf:"bytes,2,opt,name=Frame,proto3" json:"Frame,omitempty"`
@ -237,6 +448,48 @@ func (m *ImportValueRequest) String() string { return proto.CompactTe
func (*ImportValueRequest) ProtoMessage() {}
func (*ImportValueRequest) Descriptor() ([]byte, []int) { return fileDescriptorPublic, []int{11} }
func (m *ImportValueRequest) GetIndex() string {
if m != nil {
return m.Index
}
return ""
}
func (m *ImportValueRequest) GetFrame() string {
if m != nil {
return m.Frame
}
return ""
}
func (m *ImportValueRequest) GetSlice() uint64 {
if m != nil {
return m.Slice
}
return 0
}
func (m *ImportValueRequest) GetField() string {
if m != nil {
return m.Field
}
return ""
}
func (m *ImportValueRequest) GetColumnIDs() []uint64 {
if m != nil {
return m.ColumnIDs
}
return nil
}
func (m *ImportValueRequest) GetValues() []uint64 {
if m != nil {
return m.Values
}
return nil
}
func init() {
proto.RegisterType((*Bitmap)(nil), "internal.Bitmap")
proto.RegisterType((*Pair)(nil), "internal.Pair")
@ -472,7 +725,8 @@ func (m *Attr) MarshalTo(dAtA []byte) (int, error) {
if m.FloatValue != 0 {
dAtA[i] = 0x31
i++
i = encodeFixed64Public(dAtA, i, uint64(math.Float64bits(float64(m.FloatValue))))
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.FloatValue))))
i += 8
}
return i, nil
}
@ -863,24 +1117,6 @@ func (m *ImportValueRequest) MarshalTo(dAtA []byte) (int, error) {
return i, nil
}
func encodeFixed64Public(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Public(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintPublic(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
@ -1194,7 +1430,24 @@ func (m *Bitmap) Unmarshal(dAtA []byte) error {
}
switch fieldNum {
case 1:
if wireType == 2 {
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Bits = append(m.Bits, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -1235,23 +1488,6 @@ func (m *Bitmap) Unmarshal(dAtA []byte) error {
}
m.Bits = append(m.Bits, v)
}
} else if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Bits = append(m.Bits, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Bits", wireType)
}
@ -1843,15 +2079,8 @@ func (m *Attr) Unmarshal(dAtA []byte) error {
if (iNdEx + 8) > l {
return io.ErrUnexpectedEOF
}
v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:]))
iNdEx += 8
v = uint64(dAtA[iNdEx-8])
v |= uint64(dAtA[iNdEx-7]) << 8
v |= uint64(dAtA[iNdEx-6]) << 16
v |= uint64(dAtA[iNdEx-5]) << 24
v |= uint64(dAtA[iNdEx-4]) << 32
v |= uint64(dAtA[iNdEx-3]) << 40
v |= uint64(dAtA[iNdEx-2]) << 48
v |= uint64(dAtA[iNdEx-1]) << 56
m.FloatValue = float64(math.Float64frombits(v))
default:
iNdEx = preIndex
@ -2014,7 +2243,24 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error {
m.Query = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType == 2 {
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Slices = append(m.Slices, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2055,23 +2301,6 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error {
}
m.Slices = append(m.Slices, v)
}
} else if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Slices = append(m.Slices, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Slices", wireType)
}
@ -2610,7 +2839,24 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
}
}
case 4:
if wireType == 2 {
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.RowIDs = append(m.RowIDs, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2651,7 +2897,11 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
}
m.RowIDs = append(m.RowIDs, v)
}
} else if wireType == 0 {
} else {
return fmt.Errorf("proto: wrong wireType = %d for field RowIDs", wireType)
}
case 5:
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2667,12 +2917,8 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
break
}
}
m.RowIDs = append(m.RowIDs, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field RowIDs", wireType)
}
case 5:
if wireType == 2 {
m.ColumnIDs = append(m.ColumnIDs, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2713,8 +2959,12 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
}
m.ColumnIDs = append(m.ColumnIDs, v)
}
} else if wireType == 0 {
var v uint64
} else {
return fmt.Errorf("proto: wrong wireType = %d for field ColumnIDs", wireType)
}
case 6:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
@ -2724,17 +2974,13 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.ColumnIDs = append(m.ColumnIDs, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field ColumnIDs", wireType)
}
case 6:
if wireType == 2 {
m.Timestamps = append(m.Timestamps, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2775,23 +3021,6 @@ func (m *ImportRequest) Unmarshal(dAtA []byte) error {
}
m.Timestamps = append(m.Timestamps, v)
}
} else if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (int64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Timestamps = append(m.Timestamps, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamps", wireType)
}
@ -2952,7 +3181,24 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error {
m.Field = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType == 2 {
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.ColumnIDs = append(m.ColumnIDs, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -2993,7 +3239,11 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error {
}
m.ColumnIDs = append(m.ColumnIDs, v)
}
} else if wireType == 0 {
} else {
return fmt.Errorf("proto: wrong wireType = %d for field ColumnIDs", wireType)
}
case 6:
if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -3009,12 +3259,8 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error {
break
}
}
m.ColumnIDs = append(m.ColumnIDs, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field ColumnIDs", wireType)
}
case 6:
if wireType == 2 {
m.Values = append(m.Values, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
@ -3055,23 +3301,6 @@ func (m *ImportValueRequest) Unmarshal(dAtA []byte) error {
}
m.Values = append(m.Values, v)
}
} else if wireType == 0 {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPublic
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Values = append(m.Values, v)
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType)
}

View file

@ -386,6 +386,7 @@ func (s *Server) LocalStatus() (proto.Message, error) {
}
ns := internal.NodeStatus{
Scheme: s.URI.Scheme(),
Host: s.URI.HostPort(),
State: NodeStateUp,
Indexes: EncodeIndexes(s.Holder.Indexes()),