diff --git a/docs/api-reference.md b/docs/api-reference.md index 0c3990bec..bf599fafe 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -115,7 +115,7 @@ Response: } ``` -By default, all bits and attributes (*for `Bitmap` queries only*) are returned. In order to suppress returning bits, set `inhibitBits` query argument to `true`; to suppress returning attributes, set `inhibitAttrs` query argument to `true`. +By default, all bits and attributes (*for `Bitmap` queries only*) are returned. In order to suppress returning bits, set `excludeBits` query argument to `true`; to suppress returning attributes, set `excludeAttrs` query argument to `true`. ### Change index time quantum diff --git a/executor.go b/executor.go index a741dbc6e..7fa0e90af 100644 --- a/executor.go +++ b/executor.go @@ -229,7 +229,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C // If the row label is used then return bitmap attributes. bm, _ := other.(*Bitmap) if c.Name == "Bitmap" { - if opt.InhibitAttrs { + if opt.ExcludeAttrs { bm.Attrs = map[string]interface{}{} } else { idx := e.Holder.Index(index) @@ -262,7 +262,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C } } - if opt.InhibitBits { + if opt.ExcludeBits { bm.segments = []BitmapSegment{} } @@ -1379,8 +1379,8 @@ type mapResponse struct { // ExecOptions represents an execution context for a single Execute() call. type ExecOptions struct { Remote bool - InhibitAttrs bool - InhibitBits bool + ExcludeAttrs bool + ExcludeBits bool } // decodeError returns an error representation of s if s is non-blank. diff --git a/executor_test.go b/executor_test.go index 0c535799c..61bfbd053 100644 --- a/executor_test.go +++ b/executor_test.go @@ -61,7 +61,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { } // Inhibit bits. - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{InhibitBits: true}); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeBits: true}); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{}) { t.Fatalf("unexpected bits: %+v", bits) @@ -70,7 +70,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { } // Inhibit attributes. - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{InhibitAttrs: true}); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeAttrs: true}); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{3, SliceWidth + 1}) { t.Fatalf("unexpected bits: %+v", bits) diff --git a/handler.go b/handler.go index 5d5513aff..027d5f5a4 100644 --- a/handler.go +++ b/handler.go @@ -242,8 +242,8 @@ func (h *Handler) handlePostQuery(w http.ResponseWriter, r *http.Request) { // Build execution options. opt := &ExecOptions{ Remote: req.Remote, - InhibitAttrs: req.InhibitAttrs, - InhibitBits: req.InhibitBits, + ExcludeAttrs: req.ExcludeAttrs, + ExcludeBits: req.ExcludeBits, } // Parse query string. @@ -259,7 +259,7 @@ func (h *Handler) handlePostQuery(w http.ResponseWriter, r *http.Request) { resp := &QueryResponse{Results: results, Err: err} // Fill column attributes if requested. - if req.ColumnAttrs && !req.InhibitBits { + if req.ColumnAttrs && !req.ExcludeBits { // Consolidate all column ids across all calls. var columnIDs []uint64 for _, result := range results { @@ -930,8 +930,8 @@ func (h *Handler) readURLQueryRequest(r *http.Request) (*QueryRequest, error) { Query: query, Slices: slices, ColumnAttrs: q.Get("columnAttrs") == "true", - InhibitAttrs: q.Get("inhibitAttrs") == "true", - InhibitBits: q.Get("inhibitBits") == "true", + ExcludeAttrs: q.Get("excludeAttrs") == "true", + ExcludeBits: q.Get("excludeBits") == "true", }, nil } @@ -1401,10 +1401,10 @@ type QueryRequest struct { ColumnAttrs bool // Do not return row attributes, if true. - InhibitAttrs bool + ExcludeAttrs bool // Do not return bits, if true. - InhibitBits bool + ExcludeBits bool // If true, indicates that query is part of a larger distributed query. // If false, this request is on the originating node. @@ -1417,8 +1417,8 @@ func decodeQueryRequest(pb *internal.QueryRequest) *QueryRequest { Slices: pb.Slices, ColumnAttrs: pb.ColumnAttrs, Remote: pb.Remote, - InhibitAttrs: pb.InhibitAttrs, - InhibitBits: pb.InhibitBits, + ExcludeAttrs: pb.ExcludeAttrs, + ExcludeBits: pb.ExcludeBits, } return req diff --git a/internal/public.pb.go b/internal/public.pb.go index d8fa51c5d..73de1cc79 100644 --- a/internal/public.pb.go +++ b/internal/public.pb.go @@ -129,8 +129,8 @@ type QueryRequest struct { Slices []uint64 `protobuf:"varint,2,rep,packed,name=Slices" json:"Slices,omitempty"` ColumnAttrs bool `protobuf:"varint,3,opt,name=ColumnAttrs,proto3" json:"ColumnAttrs,omitempty"` Remote bool `protobuf:"varint,5,opt,name=Remote,proto3" json:"Remote,omitempty"` - InhibitAttrs bool `protobuf:"varint,6,opt,name=InhibitAttrs,proto3" json:"InhibitAttrs,omitempty"` - InhibitBits bool `protobuf:"varint,7,opt,name=InhibitBits,proto3" json:"InhibitBits,omitempty"` + ExcludeAttrs bool `protobuf:"varint,6,opt,name=ExcludeAttrs,proto3" json:"ExcludeAttrs,omitempty"` + ExcludeBits bool `protobuf:"varint,7,opt,name=ExcludeBits,proto3" json:"ExcludeBits,omitempty"` } func (m *QueryRequest) Reset() { *m = QueryRequest{} } @@ -501,20 +501,20 @@ func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { } i++ } - if m.InhibitAttrs { + if m.ExcludeAttrs { dAtA[i] = 0x30 i++ - if m.InhibitAttrs { + if m.ExcludeAttrs { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } - if m.InhibitBits { + if m.ExcludeBits { dAtA[i] = 0x38 i++ - if m.InhibitBits { + if m.ExcludeBits { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -860,10 +860,10 @@ func (m *QueryRequest) Size() (n int) { if m.Remote { n += 2 } - if m.InhibitAttrs { + if m.ExcludeAttrs { n += 2 } - if m.InhibitBits { + if m.ExcludeBits { n += 2 } return n @@ -1829,7 +1829,7 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { m.Remote = bool(v != 0) case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InhibitAttrs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeAttrs", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1846,10 +1846,10 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { break } } - m.InhibitAttrs = bool(v != 0) + m.ExcludeAttrs = bool(v != 0) case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InhibitBits", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeBits", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1866,7 +1866,7 @@ func (m *QueryRequest) Unmarshal(dAtA []byte) error { break } } - m.InhibitBits = bool(v != 0) + m.ExcludeBits = bool(v != 0) default: iNdEx = preIndex skippy, err := skipPublic(dAtA[iNdEx:]) @@ -2605,40 +2605,40 @@ func init() { proto.RegisterFile("public.proto", fileDescriptorPublic) } var fileDescriptorPublic = []byte{ // 589 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x5d, 0x8e, 0xd3, 0x30, - 0x10, 0xc6, 0x4d, 0xfa, 0x37, 0xed, 0xae, 0x2a, 0x8b, 0x9f, 0x08, 0xa1, 0x2a, 0x8a, 0x78, 0xc8, - 0x53, 0x57, 0x5a, 0x0e, 0x80, 0x48, 0xdb, 0x95, 0x22, 0xc4, 0x0a, 0xdc, 0x85, 0xf7, 0x74, 0xd7, - 0xda, 0x8d, 0x94, 0xc4, 0xc1, 0x71, 0x04, 0x3d, 0x00, 0x27, 0xe0, 0x85, 0x1b, 0xc0, 0x21, 0x38, + 0x10, 0xc6, 0x4d, 0xfa, 0x37, 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0x14, 0xc8, 0x55, 0x33, 0x4c, 0xe4, + 0x0a, 0x2d, 0xc4, 0x35, 0xb2, 0xdf, 0xef, 0x58, 0x88, 0x34, 0x33, 0x41, 0xea, 0xc1, 0x70, 0xf1, + 0x3e, 0x29, 0x6e, 0xf9, 0x56, 0x0f, 0xd3, 0x88, 0x59, 0x18, 0x7c, 0x25, 0x70, 0x12, 0xe7, 0xa5, + 0x90, 0xaa, 0xe3, 0x6e, 0x5c, 0x6c, 0xf9, 0x9d, 0x75, 0x57, 0x03, 0x64, 0x2f, 0x65, 0x92, 0x9b, + 0x31, 0x1e, 0x33, 0x03, 0x90, 0xd5, 0x2e, 0x6b, 0x57, 0x5d, 0x66, 0x80, 0xf6, 0x13, 0xd7, 0xb2, + 0xf2, 0x5c, 0x33, 0x09, 0x06, 0xe1, 0xdc, 0xda, 0xad, 0xac, 0xbc, 0xbe, 0x0e, 0xb5, 0x04, 0xce, + 0xed, 0x61, 0x2d, 0xd1, 0x6b, 0x27, 0x74, 0x58, 0x87, 0x89, 0xce, 0x7e, 0xec, 0x67, 0xe4, 0xe7, + 0x7e, 0x46, 0x7e, 0xed, 0x67, 0xe4, 0xcb, 0xef, 0xd9, 0xbd, 0x9b, 0x81, 0xfe, 0x2f, 0x3d, 0xfb, + 0x13, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x81, 0x5d, 0x51, 0xa7, 0x04, 0x00, 0x00, } diff --git a/internal/public.proto b/internal/public.proto index 50325205b..dcbcb4cf6 100644 --- a/internal/public.proto +++ b/internal/public.proto @@ -41,8 +41,8 @@ message QueryRequest { repeated uint64 Slices = 2; bool ColumnAttrs = 3; bool Remote = 5; - bool InhibitAttrs = 6; - bool InhibitBits = 7; + bool ExcludeAttrs = 6; + bool ExcludeBits = 7; } message QueryResponse {