fix(storage): Feedback in response to PR review

* Adds clarifying documentation
* Regenerate protocol buffers with updated documentation
pull/17745/head
Stuart Carnie 2020-04-16 15:19:28 -07:00
parent 6325591deb
commit c76f30682c
No known key found for this signature in database
GPG Key ID: 848D9C9718D78B4F
3 changed files with 15 additions and 10 deletions

View File

@ -987,7 +987,8 @@ func (m *TagValuesRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_TagValuesRequest proto.InternalMessageInfo
// Response message for Storage.TagKeys and Storage.TagValues.
// Response message for Storage.TagKeys, Storage.TagValues Storage.MeasurementNames,
// Storage.MeasurementTagKeys and Storage.MeasurementTagValues.
type StringValuesResponse struct {
Values [][]byte `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
}
@ -1188,6 +1189,7 @@ func (m *MeasurementFieldsRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_MeasurementFieldsRequest proto.InternalMessageInfo
// MeasurementFieldsResponse is the response message for Storage.MeasurementFields.
type MeasurementFieldsResponse struct {
Fields []MeasurementFieldsResponse_MessageField `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields"`
}

View File

@ -174,7 +174,8 @@ message TagValuesRequest {
string tag_key = 4;
}
// Response message for Storage.TagKeys and Storage.TagValues.
// Response message for Storage.TagKeys, Storage.TagValues Storage.MeasurementNames,
// Storage.MeasurementTagKeys and Storage.MeasurementTagValues.
message StringValuesResponse {
repeated bytes values = 1;
}
@ -210,6 +211,7 @@ message MeasurementFieldsRequest {
Predicate predicate = 4;
}
// MeasurementFieldsResponse is the response message for Storage.MeasurementFields.
message MeasurementFieldsResponse {
enum FieldType {
option (gogoproto.goproto_enum_prefix) = false;

View File

@ -27,19 +27,20 @@ var (
}
)
// IsLower returns true if the other FieldType has greater precedence than the
// current value. Undefined has the lowest precedence.
func (ft FieldType) IsLower(other FieldType) bool { return other < ft }
// FieldTypeToDataType returns the equivalent influxql DataType for the field type ft
// FieldTypeToDataType returns the equivalent influxql DataType for the field type ft.
// If ft is an invalid FieldType, the results are undefined.
func FieldTypeToDataType(ft FieldType) influxql.DataType {
return fieldTypeToDataTypeMapping[ft&7]
}
// IsLower returns true if the other FieldType has greater precedence than the
// current value. Undefined has the lowest precedence.
func (ft FieldType) IsLower(other FieldType) bool { return other < ft }
type MeasurementField struct {
Key string
Type FieldType
Timestamp int64
Key string // Key is the name of the field
Type FieldType // Type is field type
Timestamp int64 // Timestamp refers to the maximum timestamp observed for the given field
}
// MeasurementFieldSlice implements sort.Interface and sorts