mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 15:21:02 +00:00
Merge pull request #1539 from kuba--/core-230/go-pilosa
[CORE-230] Combine go-pilosa and pilosa into one repo
This commit is contained in:
commit
989a01db33
54 changed files with 13847 additions and 1040 deletions
6
Makefile
6
Makefile
|
|
@ -63,7 +63,7 @@ testv-race: topt-race testvsub-race
|
|||
# find which test is hung/deadlocked.
|
||||
#
|
||||
testvsub:
|
||||
set -e; for i in boltdb ctl http pg pql rbf roaring server sql txkey; do \
|
||||
set -e; for i in boltdb client ctl http pg pql rbf roaring server sql txkey; do \
|
||||
echo; echo "___ testing subpkg $$i"; \
|
||||
cd $$i; pwd; \
|
||||
$(GO) test -tags='$(BUILD_TAGS) $(TEST_TAGS)' $(TESTFLAGS) -v -timeout 60m || break; \
|
||||
|
|
@ -72,7 +72,7 @@ testvsub:
|
|||
done
|
||||
|
||||
testvsub-race:
|
||||
set -e; for i in boltdb ctl http pg pql rbf roaring server sql txkey; do \
|
||||
set -e; for i in boltdb client ctl http pg pql rbf roaring server sql txkey; do \
|
||||
echo; echo "___ testing subpkg $$i -race"; \
|
||||
cd $$i; pwd; \
|
||||
CGO_ENABLED=1 $(GO) test -tags='$(BUILD_TAGS) $(TEST_TAGS)' $(TESTFLAGS) -v -race -timeout 60m || break; \
|
||||
|
|
@ -163,7 +163,7 @@ upgrade-lattice: lattice
|
|||
|
||||
# `go generate` protocol buffers
|
||||
generate-protoc: require-protoc require-protoc-gen-gofast
|
||||
$(GO) generate github.com/pilosa/pilosa/v2/internal
|
||||
$(GO) generate github.com/pilosa/pilosa/v2/pb
|
||||
|
||||
# `go generate` statik assets (lattice UI)
|
||||
generate-statik: build-lattice require-statik
|
||||
|
|
|
|||
22
attr.go
22
attr.go
|
|
@ -19,7 +19,7 @@ import (
|
|||
"sort"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/pilosa/pilosa/v2/internal"
|
||||
"github.com/pilosa/pilosa/v2/pb"
|
||||
)
|
||||
|
||||
// Attribute data type enum.
|
||||
|
|
@ -119,21 +119,21 @@ func (a attrBlocks) Diff(other []AttrBlock) []uint64 {
|
|||
}
|
||||
}
|
||||
|
||||
func encodeAttrs(m map[string]interface{}) []*internal.Attr {
|
||||
func encodeAttrs(m map[string]interface{}) []*pb.Attr {
|
||||
keys := make([]string, 0, len(m))
|
||||
for k := range m {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
a := make([]*internal.Attr, len(keys))
|
||||
a := make([]*pb.Attr, len(keys))
|
||||
for i := range keys {
|
||||
a[i] = encodeAttr(keys[i], m[keys[i]])
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
func decodeAttrs(pb []*internal.Attr) map[string]interface{} {
|
||||
func decodeAttrs(pb []*pb.Attr) map[string]interface{} {
|
||||
m := make(map[string]interface{}, len(pb))
|
||||
for i := range pb {
|
||||
key, value := decodeAttr(pb[i])
|
||||
|
|
@ -142,9 +142,9 @@ func decodeAttrs(pb []*internal.Attr) map[string]interface{} {
|
|||
return m
|
||||
}
|
||||
|
||||
// encodeAttr converts a key/value pair into an Attr internal representation.
|
||||
func encodeAttr(key string, value interface{}) *internal.Attr {
|
||||
pb := &internal.Attr{Key: key}
|
||||
// encodeAttr converts a key/value pair into an Attr pb.representation.
|
||||
func encodeAttr(key string, value interface{}) *pb.Attr {
|
||||
pb := &pb.Attr{Key: key}
|
||||
switch value := value.(type) {
|
||||
case string:
|
||||
pb.Type = attrTypeString
|
||||
|
|
@ -165,8 +165,8 @@ func encodeAttr(key string, value interface{}) *internal.Attr {
|
|||
return pb
|
||||
}
|
||||
|
||||
// decodeAttr converts from an Attr internal representation to a key/value pair.
|
||||
func decodeAttr(attr *internal.Attr) (key string, value interface{}) {
|
||||
// decodeAttr converts from an Attr pb.representation to a key/value pair.
|
||||
func decodeAttr(attr *pb.Attr) (key string, value interface{}) {
|
||||
switch attr.Type {
|
||||
case attrTypeString:
|
||||
return attr.Key, attr.StringValue
|
||||
|
|
@ -192,12 +192,12 @@ func cloneAttrs(m map[string]interface{}) map[string]interface{} {
|
|||
|
||||
// EncodeAttrs encodes an attribute map into a byte slice.
|
||||
func EncodeAttrs(attr map[string]interface{}) ([]byte, error) {
|
||||
return proto.Marshal(&internal.AttrMap{Attrs: encodeAttrs(attr)})
|
||||
return proto.Marshal(&pb.AttrMap{Attrs: encodeAttrs(attr)})
|
||||
}
|
||||
|
||||
// DecodeAttrs decodes a byte slice into an attribute map.
|
||||
func DecodeAttrs(v []byte) (map[string]interface{}, error) {
|
||||
var pb internal.AttrMap
|
||||
var pb pb.AttrMap
|
||||
if err := proto.Unmarshal(v, &pb); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ type FieldValue struct {
|
|||
// something hasn't been architected correctly.
|
||||
// While I understand that putting the entire Client behind an interface might require this many methods,
|
||||
// I don't want to let it go unquestioned.
|
||||
// Another note from Travis: I think we eventually want to unify `InternalClient` with the `go-pilosa` client.
|
||||
// Another note from Travis: I think we eventually want to unify `InternalClient` with
|
||||
// the `github.com/pilosa/pilosa/v2/client` client.
|
||||
// Doing that may obviate the need to refactor this.
|
||||
type InternalClient interface {
|
||||
InternalQueryClient
|
||||
|
|
|
|||
85
client/README.md
Normal file
85
client/README.md
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
# Go Client for Pilosa
|
||||
|
||||
Go client for Pilosa high performance distributed index.
|
||||
|
||||
## Usage
|
||||
|
||||
If you have the pilosa repo in your `GOPATH`,
|
||||
you can import the library in your code using:
|
||||
|
||||
```go
|
||||
import "github.com/pilosa/pilosa/v2/client"
|
||||
```
|
||||
|
||||
|
||||
### Quick overview
|
||||
|
||||
Assuming [Pilosa](https://github.com/pilosa/pilosa) server is running at `localhost:10101` (the default):
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create the default client
|
||||
cli := client.DefaultClient()
|
||||
|
||||
// Retrieve the schema
|
||||
schema, err := cli.Schema()
|
||||
|
||||
// Create an Index object
|
||||
myindex := schema.Index("myindex")
|
||||
|
||||
// Create a Field object
|
||||
myfield := myindex.Field("myfield")
|
||||
|
||||
// make sure the index and the field exists on the server
|
||||
err := cli.SyncSchema(schema)
|
||||
|
||||
// Send a Set query. If err is non-nil, response will be nil.
|
||||
response, err := cli.Query(myfield.Set(5, 42))
|
||||
|
||||
// Send a Row query. If err is non-nil, response will be nil.
|
||||
response, err = cli.Query(myfield.Row(5))
|
||||
|
||||
// Get the result
|
||||
result := response.Result()
|
||||
// Act on the result
|
||||
if result != nil {
|
||||
columns := result.Row().Columns
|
||||
fmt.Println("Got columns: ", columns)
|
||||
}
|
||||
|
||||
// You can batch queries to improve throughput
|
||||
response, err = cli.Query(myindex.BatchQuery(
|
||||
myfield.Row(5),
|
||||
myfield.Row(10)))
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
for _, result := range response.Results() {
|
||||
// Act on the result
|
||||
fmt.Println(result.Row().Columns)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
### Data Model and Queries
|
||||
|
||||
See: [Data Model and Queries](docs/data-model-queries.md)
|
||||
|
||||
### Executing Queries
|
||||
|
||||
See: [Server Interaction](docs/server-interaction.md)
|
||||
|
||||
### Other Documentation
|
||||
|
||||
* [Tracing](docs/tracing.md)
|
||||
1404
client/batch.go
Normal file
1404
client/batch.go
Normal file
File diff suppressed because it is too large
Load diff
1311
client/batch_test.go
Normal file
1311
client/batch_test.go
Normal file
File diff suppressed because it is too large
Load diff
1797
client/client.go
Normal file
1797
client/client.go
Normal file
File diff suppressed because it is too large
Load diff
85
client/client_internal_it_test.go
Normal file
85
client/client_internal_it_test.go
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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.
|
||||
|
||||
//+build integration
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
)
|
||||
|
||||
func TestNewClientFromAddresses(t *testing.T) {
|
||||
cases := []struct {
|
||||
Name string
|
||||
Hosts []string
|
||||
ExpectErr bool
|
||||
ExpectedHosts []pnet.URI
|
||||
}{
|
||||
{
|
||||
Name: "Cluster",
|
||||
Hosts: []string{":10101", "node0.pilosa.com:10101", "node2.pilosa.com"},
|
||||
ExpectedHosts: []pnet.URI{
|
||||
{Scheme: "http", Port: 10101, Host: "localhost"},
|
||||
{Scheme: "http", Port: 10101, Host: "node0.pilosa.com"},
|
||||
{Scheme: "http", Port: 10101, Host: "node2.pilosa.com"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "URIParseError",
|
||||
Hosts: []string{"://"},
|
||||
ExpectErr: true,
|
||||
},
|
||||
{
|
||||
Name: "Empty",
|
||||
Hosts: []string{},
|
||||
ExpectedHosts: []pnet.URI{},
|
||||
},
|
||||
{
|
||||
Name: "nil",
|
||||
ExpectedHosts: []pnet.URI{},
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
c := c
|
||||
t.Run(c.Name, func(t *testing.T) {
|
||||
cli, err := NewClient(c.Hosts)
|
||||
if c.ExpectErr {
|
||||
if err == nil {
|
||||
t.Fatalf("Did not get expected error when creating client: %v", cli.cluster.Hosts())
|
||||
}
|
||||
} else {
|
||||
if err != nil {
|
||||
t.Fatalf("Creating client from addresses: %v", err)
|
||||
}
|
||||
if actualHosts := cli.cluster.Hosts(); !reflect.DeepEqual(actualHosts, c.ExpectedHosts) {
|
||||
t.Fatalf("Unexpected hosts in client's cluster, got: %v, expected: %v", actualHosts, c.ExpectedHosts)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectClusterChanges(t *testing.T) {
|
||||
c := getClient()
|
||||
defer c.Close()
|
||||
c.shardNodes.data["blah"] = make(map[uint64][]*pnet.URI)
|
||||
c.shardNodes.data["blah"][1] = []*pnet.URI{{Scheme: "zzz"}}
|
||||
|
||||
c.detectClusterChanges()
|
||||
}
|
||||
2058
client/client_it_test.go
Normal file
2058
client/client_it_test.go
Normal file
File diff suppressed because it is too large
Load diff
293
client/client_test.go
Normal file
293
client/client_test.go
Normal file
|
|
@ -0,0 +1,293 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
)
|
||||
|
||||
func TestQueryWithError(t *testing.T) {
|
||||
var err error
|
||||
client := DefaultClient()
|
||||
index := NewIndex("foo")
|
||||
field := index.Field("foo")
|
||||
invalid := field.FilterAttrTopN(12, field.Row(7), "$invalid$", 80, 81)
|
||||
_, err = client.Query(invalid, nil)
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestClientOptions(t *testing.T) {
|
||||
targets := []*ClientOptions{
|
||||
{SocketTimeout: 10},
|
||||
{ConnectTimeout: 5},
|
||||
{PoolSizePerRoute: 7},
|
||||
{TotalPoolSize: 17},
|
||||
{TLSConfig: &tls.Config{InsecureSkipVerify: true}},
|
||||
}
|
||||
optionsList := [][]ClientOption{
|
||||
{OptClientSocketTimeout(10)},
|
||||
{OptClientConnectTimeout(5)},
|
||||
{OptClientPoolSizePerRoute(7)},
|
||||
{OptClientTotalPoolSize(17)},
|
||||
{OptClientTLSConfig(&tls.Config{InsecureSkipVerify: true})},
|
||||
}
|
||||
|
||||
for i := 0; i < len(targets); i++ {
|
||||
options := &ClientOptions{}
|
||||
err := options.addOptions(optionsList[i]...)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
target := targets[i]
|
||||
if !reflect.DeepEqual(target, options) {
|
||||
t.Fatalf("%v != %v", target, options)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClientWithErrorredOption(t *testing.T) {
|
||||
_, err := NewClient(":8888", ClientOptionErr(0))
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClient(t *testing.T) {
|
||||
client, err := NewClient(":9999", OptClientManualServerAddress(true))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
targetURI, err := pnet.NewURIFromAddress(":9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(targetURI, client.manualServerURI) {
|
||||
t.Fatalf("%v != %v", targetURI, client.manualServerURI)
|
||||
}
|
||||
targetFragmentNode := &fragmentNode{
|
||||
Scheme: "http",
|
||||
Host: "localhost",
|
||||
Port: 9999,
|
||||
}
|
||||
if !reflect.DeepEqual(targetFragmentNode, client.manualFragmentNode) {
|
||||
t.Fatalf("%v != %v", targetFragmentNode, client.manualFragmentNode)
|
||||
}
|
||||
client, err = NewClient(":9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
targetURI, err = pnet.NewURIFromAddress(":9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
target := []*pnet.URI{targetURI}
|
||||
if !reflect.DeepEqual(target, client.cluster.hosts) {
|
||||
t.Fatalf("%v != %v", target, client.cluster.hosts)
|
||||
}
|
||||
client, err = NewClient([]string{":9999"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(target, client.cluster.hosts) {
|
||||
t.Fatalf("%v != %v", target, client.cluster.hosts)
|
||||
}
|
||||
|
||||
targetURI1, err := pnet.NewURIFromAddress(":8888")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
targetURI2, err := pnet.NewURIFromAddress(":9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
client, err = NewClient([]*pnet.URI{targetURI1, targetURI2})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
target = []*pnet.URI{targetURI1, targetURI2}
|
||||
if !reflect.DeepEqual(target, client.cluster.hosts) {
|
||||
t.Fatalf("%v != %v", target, client.cluster.hosts)
|
||||
}
|
||||
|
||||
client, err = NewClient([]*pnet.URI{targetURI})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
target = []*pnet.URI{targetURI}
|
||||
if !reflect.DeepEqual(target, client.cluster.hosts) {
|
||||
t.Fatalf("%v != %v", target, client.cluster.hosts)
|
||||
}
|
||||
|
||||
client, err = NewClient(DefaultCluster())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
target = []*pnet.URI{}
|
||||
if !reflect.DeepEqual(target, client.cluster.hosts) {
|
||||
t.Fatalf("%v != %v", target, client.cluster.hosts)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClientWithInvalidAddr(t *testing.T) {
|
||||
_, err := NewClient(10)
|
||||
if err != ErrAddrURIClusterExpected {
|
||||
t.Fatalf("%v != %v", ErrAddrURIClusterExpected, err)
|
||||
}
|
||||
_, err = NewClient(":invalid")
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed: %+v", err)
|
||||
}
|
||||
_, err = NewClient([]string{"valid:8000", ":invalid"})
|
||||
if err != pnet.ErrInvalidAddress {
|
||||
t.Fatalf("Should have failed '%v, got '%v'", pnet.ErrInvalidAddress, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClientManualAddressWithNoURIs(t *testing.T) {
|
||||
_, err := NewClient([]string{}, OptClientManualServerAddress(true))
|
||||
if err != ErrSingleServerAddressRequired {
|
||||
t.Fatalf("%v != %v", ErrSingleServerAddressRequired, err)
|
||||
}
|
||||
_, err = NewClient([]*pnet.URI{}, OptClientManualServerAddress(true))
|
||||
if err != ErrSingleServerAddressRequired {
|
||||
t.Fatalf("%v != %v", ErrSingleServerAddressRequired, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewClientManualAddressWithMultipleURIs(t *testing.T) {
|
||||
_, err := NewClient([]string{":9000", ":5000"}, OptClientManualServerAddress(true))
|
||||
if err != ErrSingleServerAddressRequired {
|
||||
t.Fatalf("%v != %v", ErrSingleServerAddressRequired, err)
|
||||
}
|
||||
|
||||
targetURI1, err := pnet.NewURIFromAddress(":9000")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
targetURI2, err := pnet.NewURIFromAddress(":5000")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = NewClient([]*pnet.URI{targetURI1, targetURI2}, OptClientManualServerAddress(true))
|
||||
if err != ErrSingleServerAddressRequired {
|
||||
t.Fatalf("%v != %v", ErrSingleServerAddressRequired, err)
|
||||
}
|
||||
}
|
||||
|
||||
func ClientOptionErr(int) ClientOption {
|
||||
return func(*ClientOptions) error {
|
||||
return errors.New("Some error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryOptions(t *testing.T) {
|
||||
targets := []*QueryOptions{
|
||||
{ColumnAttrs: true},
|
||||
{ColumnAttrs: false},
|
||||
{ExcludeRowAttrs: true},
|
||||
{ExcludeRowAttrs: false},
|
||||
{ExcludeColumns: true},
|
||||
{ExcludeColumns: false},
|
||||
}
|
||||
|
||||
optionsList := [][]interface{}{
|
||||
{OptQueryColumnAttrs(true)},
|
||||
{OptQueryColumnAttrs(false)},
|
||||
{OptQueryExcludeAttrs(true)},
|
||||
{OptQueryExcludeAttrs(false)},
|
||||
{OptQueryExcludeColumns(true)},
|
||||
{OptQueryExcludeColumns(false)},
|
||||
}
|
||||
|
||||
for i := 0; i < len(targets); i++ {
|
||||
options := &QueryOptions{}
|
||||
err := options.addOptions(optionsList[i]...)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
target := targets[i]
|
||||
if !reflect.DeepEqual(target, options) {
|
||||
t.Fatalf("%v != %v", target, options)
|
||||
}
|
||||
}
|
||||
|
||||
target := &QueryOptions{
|
||||
ColumnAttrs: true,
|
||||
ExcludeRowAttrs: true,
|
||||
ExcludeColumns: true,
|
||||
}
|
||||
options := &QueryOptions{}
|
||||
err := options.addOptions(&QueryOptions{
|
||||
ColumnAttrs: true,
|
||||
ExcludeRowAttrs: true,
|
||||
ExcludeColumns: true,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(target, options) {
|
||||
t.Fatalf("%v != %v", target, options)
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryOptionsWithError(t *testing.T) {
|
||||
options := &QueryOptions{}
|
||||
err := options.addOptions(1)
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
err = options.addOptions(OptQueryColumnAttrs(true), nil)
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
err = options.addOptions(OptQueryColumnAttrs(true), &QueryOptions{})
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
err = options.addOptions(QueryOptionErr(0))
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryOptionsError(t *testing.T) {
|
||||
client := DefaultClient()
|
||||
index := NewIndex("foo")
|
||||
_, err := client.Query(index.RawQuery(""), QueryOptionErr(0))
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func QueryOptionErr(int) QueryOption {
|
||||
return func(*QueryOptions) error {
|
||||
return errors.New("Some error")
|
||||
}
|
||||
}
|
||||
112
client/cluster.go
Normal file
112
client/cluster.go
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
)
|
||||
|
||||
// Cluster contains hosts in a Pilosa cluster.
|
||||
type Cluster struct {
|
||||
hosts []*pnet.URI
|
||||
okList []bool
|
||||
mutex *sync.RWMutex
|
||||
lastHostIdx int
|
||||
}
|
||||
|
||||
// DefaultCluster returns the default Cluster.
|
||||
func DefaultCluster() *Cluster {
|
||||
return &Cluster{
|
||||
hosts: make([]*pnet.URI, 0),
|
||||
okList: make([]bool, 0),
|
||||
mutex: &sync.RWMutex{},
|
||||
}
|
||||
}
|
||||
|
||||
// NewClusterWithHost returns a cluster with the given URIs.
|
||||
func NewClusterWithHost(hosts ...*pnet.URI) *Cluster {
|
||||
cluster := DefaultCluster()
|
||||
for _, host := range hosts {
|
||||
cluster.AddHost(host)
|
||||
}
|
||||
return cluster
|
||||
}
|
||||
|
||||
// AddHost adds a host to the cluster.
|
||||
func (c *Cluster) AddHost(address *pnet.URI) {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
c.hosts = append(c.hosts, address)
|
||||
c.okList = append(c.okList, true)
|
||||
}
|
||||
|
||||
// Host returns a host in the cluster.
|
||||
func (c *Cluster) Host() *pnet.URI {
|
||||
c.mutex.Lock()
|
||||
var host *pnet.URI
|
||||
for i := range c.okList {
|
||||
idx := (i + c.lastHostIdx) % len(c.okList)
|
||||
ok := c.okList[idx]
|
||||
if ok {
|
||||
host = c.hosts[idx]
|
||||
break
|
||||
}
|
||||
}
|
||||
c.lastHostIdx++
|
||||
c.mutex.Unlock()
|
||||
if host != nil {
|
||||
return host
|
||||
}
|
||||
c.reset()
|
||||
return host
|
||||
}
|
||||
|
||||
// RemoveHost black lists the host with the given pnet.URI from the cluster.
|
||||
func (c *Cluster) RemoveHost(address *pnet.URI) {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
for i, uri := range c.hosts {
|
||||
if uri.Equals(address) {
|
||||
c.okList[i] = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hosts returns all available hosts in the cluster.
|
||||
func (c *Cluster) Hosts() []pnet.URI {
|
||||
c.mutex.RLock()
|
||||
defer c.mutex.RUnlock()
|
||||
hosts := make([]pnet.URI, 0, len(c.hosts))
|
||||
for i, host := range c.hosts {
|
||||
if c.okList[i] {
|
||||
hosts = append(hosts, *host)
|
||||
}
|
||||
}
|
||||
return hosts
|
||||
}
|
||||
|
||||
func (c *Cluster) reset() {
|
||||
c.mutex.Lock()
|
||||
defer c.mutex.Unlock()
|
||||
for i := range c.okList {
|
||||
c.okList[i] = true
|
||||
}
|
||||
}
|
||||
83
client/cluster_test.go
Normal file
83
client/cluster_test.go
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
)
|
||||
|
||||
func TestNewClusterWithHost(t *testing.T) {
|
||||
c := NewClusterWithHost(pnet.DefaultURI())
|
||||
hosts := c.Hosts()
|
||||
if len(hosts) != 1 || !hosts[0].Equals(pnet.DefaultURI()) {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddHost(t *testing.T) {
|
||||
const addr = "http://localhost:3000"
|
||||
c := DefaultCluster()
|
||||
if c.Hosts() == nil {
|
||||
t.Fatalf("Hosts should not be nil")
|
||||
}
|
||||
uri, err := pnet.NewURIFromAddress(addr)
|
||||
if err != nil {
|
||||
t.Fatalf("Cannot parse address")
|
||||
}
|
||||
target, err := pnet.NewURIFromAddress(addr)
|
||||
if err != nil {
|
||||
t.Fatalf("Cannot parse address")
|
||||
}
|
||||
c.AddHost(uri)
|
||||
hosts := c.Hosts()
|
||||
if len(hosts) != 1 || !hosts[0].Equals(target) {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestHosts(t *testing.T) {
|
||||
c := DefaultCluster()
|
||||
if c.Host() != nil {
|
||||
t.Fatalf("Hosts with empty cluster should return nil")
|
||||
}
|
||||
c = NewClusterWithHost(pnet.DefaultURI())
|
||||
if !c.Host().Equals(pnet.DefaultURI()) {
|
||||
t.Fatalf("Host should return a value if there are hosts in the cluster")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveHost(t *testing.T) {
|
||||
uri, err := pnet.NewURIFromAddress("index1.pilosa.com:9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
c := NewClusterWithHost(uri)
|
||||
if len(c.hosts) != 1 {
|
||||
t.Fatalf("The cluster should contain the host")
|
||||
}
|
||||
uri, err = pnet.NewURIFromAddress("index1.pilosa.com:9999")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
c.RemoveHost(uri)
|
||||
if len(c.Hosts()) != 0 {
|
||||
t.Fatalf("The cluster should not contain the host")
|
||||
}
|
||||
}
|
||||
194
client/csv/csv.go
Normal file
194
client/csv/csv.go
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 csv
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
)
|
||||
|
||||
// Format is the format of the data in the CSV file.
|
||||
type Format uint
|
||||
|
||||
const (
|
||||
// RowIDColumnID formatted data is ROW_ID,COLUMN_ID.
|
||||
RowIDColumnID Format = iota
|
||||
// RowIDColumnKey formatted data is ROW_ID,COLUMN_KEY.
|
||||
RowIDColumnKey
|
||||
// RowKeyColumnID formatted data is ROW_KEY,COLUMN_ID.
|
||||
RowKeyColumnID
|
||||
// RowKeyColumnKey formatted data is ROW_KEY,COLUMN_ID.
|
||||
RowKeyColumnKey
|
||||
// ColumnID formatted data is COLUMN_ID. Valid only for value import.
|
||||
ColumnID
|
||||
// ColumnKey formatted data is COLUMN_KEY. Valud only for value import.
|
||||
ColumnKey
|
||||
)
|
||||
|
||||
// ColumnUnmarshaller creates a RecordUnmarshaller for importing columns with the given format.
|
||||
func ColumnUnmarshaller(format Format) RecordUnmarshaller {
|
||||
return ColumnUnmarshallerWithTimestamp(format, "")
|
||||
}
|
||||
|
||||
// ColumnUnmarshallerWithTimestamp creates a RecordUnmarshaller for importing columns with the given format and timestamp format.
|
||||
func ColumnUnmarshallerWithTimestamp(format Format, timestampFormat string) RecordUnmarshaller {
|
||||
return func(text string) (client.Record, error) {
|
||||
var err error
|
||||
column := client.Column{}
|
||||
parts := strings.Split(text, ",")
|
||||
if len(parts) < 2 {
|
||||
return nil, errors.New("Invalid CSV line")
|
||||
}
|
||||
|
||||
hasRowKey := format == RowKeyColumnID || format == RowKeyColumnKey
|
||||
hasColumnKey := format == RowIDColumnKey || format == RowKeyColumnKey
|
||||
|
||||
if hasRowKey {
|
||||
column.RowKey = parts[0]
|
||||
} else {
|
||||
column.RowID, err = strconv.ParseUint(parts[0], 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.New("Invalid row ID")
|
||||
}
|
||||
}
|
||||
|
||||
if hasColumnKey {
|
||||
column.ColumnKey = parts[1]
|
||||
} else {
|
||||
column.ColumnID, err = strconv.ParseUint(parts[1], 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.New("Invalid column ID")
|
||||
}
|
||||
}
|
||||
|
||||
timestamp := int64(0)
|
||||
if len(parts) == 3 {
|
||||
if timestampFormat == "" {
|
||||
if tsInt, err := strconv.Atoi(parts[2]); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
timestamp = int64(tsInt)
|
||||
}
|
||||
} else {
|
||||
t, err := time.Parse(timestampFormat, parts[2])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
timestamp = t.Unix() * int64(time.Second) // Casting a duration to int64 gives the number of nanoseconds in that duration.
|
||||
}
|
||||
}
|
||||
column.Timestamp = timestamp
|
||||
|
||||
return column, nil
|
||||
}
|
||||
}
|
||||
|
||||
// RecordUnmarshaller is a function which creates a Record from a CSV file line with column data.
|
||||
type RecordUnmarshaller func(text string) (client.Record, error)
|
||||
|
||||
// Iterator reads records from a Reader.
|
||||
// Each line should contain a single record in the following form:
|
||||
// field1,field2,...
|
||||
type Iterator struct {
|
||||
reader io.Reader
|
||||
line int
|
||||
scanner *bufio.Scanner
|
||||
unmarshaller RecordUnmarshaller
|
||||
}
|
||||
|
||||
// NewIterator creates a CSVIterator from a Reader.
|
||||
func NewIterator(reader io.Reader, unmarshaller RecordUnmarshaller) *Iterator {
|
||||
return &Iterator{
|
||||
reader: reader,
|
||||
line: 0,
|
||||
scanner: bufio.NewScanner(reader),
|
||||
unmarshaller: unmarshaller,
|
||||
}
|
||||
}
|
||||
|
||||
// NewColumnIterator creates a new iterator for column data.
|
||||
func NewColumnIterator(format Format, reader io.Reader) *Iterator {
|
||||
return NewIterator(reader, ColumnUnmarshaller(format))
|
||||
}
|
||||
|
||||
// NewColumnIteratorWithTimestampFormat creates a new iterator for column data with timestamp.
|
||||
func NewColumnIteratorWithTimestampFormat(format Format, reader io.Reader, timestampFormat string) *Iterator {
|
||||
return NewIterator(reader, ColumnUnmarshallerWithTimestamp(format, timestampFormat))
|
||||
}
|
||||
|
||||
// NewValueIterator creates a new iterator for value data.
|
||||
func NewValueIterator(format Format, reader io.Reader) *Iterator {
|
||||
return NewIterator(reader, FieldValueUnmarshaller(format))
|
||||
}
|
||||
|
||||
// NextRecord iterates on lines of a Reader.
|
||||
// Returns io.EOF on end of iteration.
|
||||
func (c *Iterator) NextRecord() (client.Record, error) {
|
||||
if ok := c.scanner.Scan(); ok {
|
||||
c.line++
|
||||
text := strings.TrimSpace(c.scanner.Text())
|
||||
if text != "" {
|
||||
rc, err := c.unmarshaller(text)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s at line: %d", err.Error(), c.line)
|
||||
}
|
||||
return rc, nil
|
||||
}
|
||||
}
|
||||
err := c.scanner.Err()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
// FieldValueUnmarshaller is a function which creates a Record from a CSV file line with value data.
|
||||
func FieldValueUnmarshaller(format Format) RecordUnmarshaller {
|
||||
return func(text string) (client.Record, error) {
|
||||
parts := strings.Split(text, ",")
|
||||
if len(parts) < 2 {
|
||||
return nil, errors.New("Invalid CSV")
|
||||
}
|
||||
value, err := strconv.ParseInt(parts[1], 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.New("Invalid value")
|
||||
}
|
||||
switch format {
|
||||
case ColumnID:
|
||||
columnID, err := strconv.ParseUint(parts[0], 10, 64)
|
||||
if err != nil {
|
||||
return nil, errors.New("Invalid column ID at line: %d")
|
||||
}
|
||||
return client.FieldValue{
|
||||
ColumnID: uint64(columnID),
|
||||
Value: value,
|
||||
}, nil
|
||||
case ColumnKey:
|
||||
return client.FieldValue{
|
||||
ColumnKey: parts[0],
|
||||
Value: value,
|
||||
}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("Invalid format: %d", format)
|
||||
}
|
||||
}
|
||||
}
|
||||
60
client/csv/csv_it_test.go
Normal file
60
client/csv/csv_it_test.go
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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.
|
||||
|
||||
//+build integration
|
||||
|
||||
package csv_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
"github.com/pilosa/pilosa/v2/client/csv"
|
||||
)
|
||||
|
||||
func TestCSVIterate(t *testing.T) {
|
||||
text := `10,7
|
||||
10,5
|
||||
2,3
|
||||
7,1`
|
||||
iterator := csv.NewColumnIterator(csv.RowIDColumnID, strings.NewReader(text))
|
||||
recs := consumeIterator(t, iterator)
|
||||
target := []client.Record{
|
||||
client.Column{RowID: 10, ColumnID: 7},
|
||||
client.Column{RowID: 10, ColumnID: 5},
|
||||
client.Column{RowID: 2, ColumnID: 3},
|
||||
client.Column{RowID: 7, ColumnID: 1},
|
||||
}
|
||||
if !reflect.DeepEqual(target, recs) {
|
||||
t.Fatalf("%v != %v", target, recs)
|
||||
}
|
||||
}
|
||||
|
||||
func consumeIterator(t *testing.T, it *csv.Iterator) []client.Record {
|
||||
recs := []client.Record{}
|
||||
for {
|
||||
r, err := it.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
recs = append(recs, r)
|
||||
}
|
||||
return recs
|
||||
}
|
||||
267
client/csv/csv_test.go
Normal file
267
client/csv/csv_test.go
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 csv_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/pilosa/pilosa/v2"
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
"github.com/pilosa/pilosa/v2/client/csv"
|
||||
)
|
||||
|
||||
func TestCSVColumnIterator(t *testing.T) {
|
||||
reader := strings.NewReader(`1,10,683793200
|
||||
5,20,683793300
|
||||
3,41,683793385`)
|
||||
iterator := csv.NewColumnIterator(csv.RowIDColumnID, reader)
|
||||
columns := []client.Record{}
|
||||
for {
|
||||
column, err := iterator.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
columns = append(columns, column)
|
||||
}
|
||||
if len(columns) != 3 {
|
||||
t.Fatalf("There should be 3 columns")
|
||||
}
|
||||
target := []client.Column{
|
||||
{RowID: 1, ColumnID: 10, Timestamp: 683793200},
|
||||
{RowID: 5, ColumnID: 20, Timestamp: 683793300},
|
||||
{RowID: 3, ColumnID: 41, Timestamp: 683793385},
|
||||
}
|
||||
for i := range target {
|
||||
if !reflect.DeepEqual(target[i], columns[i]) {
|
||||
t.Fatalf("%v != %v", target[i], columns[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVColumnIteratorWithTimestampFormatRowIDColumnID(t *testing.T) {
|
||||
format := "2006-01-02T03:04"
|
||||
reader := strings.NewReader(`1,10,1991-09-02T09:33
|
||||
5,20,1991-09-02T09:35
|
||||
3,41,1991-09-02T09:36`)
|
||||
iterator := csv.NewColumnIteratorWithTimestampFormat(csv.RowIDColumnID, reader, format)
|
||||
records := []client.Record{}
|
||||
for {
|
||||
record, err := iterator.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
records = append(records, record)
|
||||
}
|
||||
target := []client.Column{
|
||||
{RowID: 1, ColumnID: 10, Timestamp: 683803980000000000},
|
||||
{RowID: 5, ColumnID: 20, Timestamp: 683804100000000000},
|
||||
{RowID: 3, ColumnID: 41, Timestamp: 683804160000000000},
|
||||
}
|
||||
if len(records) != len(target) {
|
||||
t.Fatalf("There should be %d columns", len(target))
|
||||
}
|
||||
for i := range target {
|
||||
if !reflect.DeepEqual(target[i], records[i]) {
|
||||
t.Fatalf("%v != %v", target[i], records[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVColumnIteratorWithTimestampFormatRowKeyColumnKey(t *testing.T) {
|
||||
format := "2006-01-02T03:04"
|
||||
reader := strings.NewReader(`one,ten,1991-09-02T09:33
|
||||
five,twenty,1991-09-02T09:35
|
||||
three,forty-one,1991-09-02T09:36`)
|
||||
iterator := csv.NewColumnIteratorWithTimestampFormat(csv.RowKeyColumnKey, reader, format)
|
||||
records := []client.Record{}
|
||||
for {
|
||||
record, err := iterator.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
records = append(records, record)
|
||||
}
|
||||
target := []client.Column{
|
||||
{RowKey: "one", ColumnKey: "ten", Timestamp: 683803980000000000},
|
||||
{RowKey: "five", ColumnKey: "twenty", Timestamp: 683804100000000000},
|
||||
{RowKey: "three", ColumnKey: "forty-one", Timestamp: 683804160000000000},
|
||||
}
|
||||
if len(records) != len(target) {
|
||||
t.Fatalf("There should be %d columns", len(target))
|
||||
}
|
||||
for i := range target {
|
||||
if !reflect.DeepEqual(target[i], records[i]) {
|
||||
t.Fatalf("%v != %v", target[i], records[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVColumnIteratorWithTimestampFormatFail(t *testing.T) {
|
||||
format := "2014-07-16"
|
||||
reader := strings.NewReader(`1,10,X`)
|
||||
iterator := csv.NewColumnIteratorWithTimestampFormat(csv.RowIDColumnID, reader, format)
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVValueIteratorWithColumnID(t *testing.T) {
|
||||
reader := strings.NewReader(`1,10
|
||||
5,-20
|
||||
3,41
|
||||
`)
|
||||
iterator := csv.NewValueIterator(csv.ColumnID, reader)
|
||||
values := []client.Record{}
|
||||
for {
|
||||
value, err := iterator.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
values = append(values, value)
|
||||
}
|
||||
target := []pilosa.FieldValue{
|
||||
{ColumnID: 1, Value: 10},
|
||||
{ColumnID: 5, Value: -20},
|
||||
{ColumnID: 3, Value: 41},
|
||||
}
|
||||
if len(values) != len(target) {
|
||||
t.Fatalf("There should be %d values, got %d", len(target), len(values))
|
||||
}
|
||||
for i := range target {
|
||||
v := values[i].(client.FieldValue)
|
||||
if !reflect.DeepEqual(pilosa.FieldValue(v), target[i]) {
|
||||
t.Fatalf("'%+v' != '%+v'", target[i], values[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVValueIteratorWithColumnKey(t *testing.T) {
|
||||
reader := strings.NewReader(`one,10
|
||||
five,-20
|
||||
three,41
|
||||
`)
|
||||
iterator := csv.NewValueIterator(csv.ColumnKey, reader)
|
||||
values := []client.Record{}
|
||||
for {
|
||||
value, err := iterator.NextRecord()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
values = append(values, value)
|
||||
}
|
||||
target := []pilosa.FieldValue{
|
||||
{ColumnKey: "one", Value: 10},
|
||||
{ColumnKey: "five", Value: -20},
|
||||
{ColumnKey: "three", Value: 41},
|
||||
}
|
||||
if len(values) != len(target) {
|
||||
t.Fatalf("There should be %d values, got %d", len(target), len(values))
|
||||
}
|
||||
for i := range target {
|
||||
v := values[i].(client.FieldValue)
|
||||
if !reflect.DeepEqual(pilosa.FieldValue(v), target[i]) {
|
||||
t.Fatalf("%v != %v", target[i], values[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSValueIteratorWithInvalidFormat(t *testing.T) {
|
||||
reader := strings.NewReader("1,2")
|
||||
iterator := csv.NewValueIterator(csv.RowIDColumnID, reader)
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatalf("should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVColumnIteratorInvalidInput(t *testing.T) {
|
||||
invalidInputs := []string{
|
||||
// less than 2 columns
|
||||
"155",
|
||||
// invalid row ID
|
||||
"a5,155",
|
||||
// invalid column ID
|
||||
"155,a5",
|
||||
// invalid timestamp
|
||||
"155,255,a5",
|
||||
}
|
||||
for _, text := range invalidInputs {
|
||||
iterator := csv.NewColumnIterator(csv.RowIDColumnID, strings.NewReader(text))
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatalf("CSVColumnIterator input: %s should fail", text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVValueIteratorInvalidInput(t *testing.T) {
|
||||
invalidInputs := []string{
|
||||
// less than 2 columns
|
||||
"155",
|
||||
// invalid column ID
|
||||
"a5,155",
|
||||
// invalid value
|
||||
"155,a5",
|
||||
}
|
||||
for _, text := range invalidInputs {
|
||||
iterator := csv.NewValueIterator(csv.ColumnID, strings.NewReader(text))
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatalf("CSVValueIterator input: %s should fail", text)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVColumnIteratorError(t *testing.T) {
|
||||
iterator := csv.NewColumnIterator(csv.RowIDColumnID, &BrokenReader{})
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatal("CSVColumnIterator should fail with error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCSVValueIteratorError(t *testing.T) {
|
||||
iterator := csv.NewValueIterator(csv.ColumnID, &BrokenReader{})
|
||||
_, err := iterator.NextRecord()
|
||||
if err == nil {
|
||||
t.Fatal("CSVValueIterator should fail with error")
|
||||
}
|
||||
}
|
||||
|
||||
type BrokenReader struct{}
|
||||
|
||||
func (r BrokenReader) Read(p []byte) (n int, err error) {
|
||||
return 0, errors.New("broken reader")
|
||||
}
|
||||
68
client/doc.go
Normal file
68
client/doc.go
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
/*
|
||||
Package client enables querying a Pilosa server.
|
||||
|
||||
This client uses Pilosa's http+protobuf API.
|
||||
|
||||
Usage:
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
)
|
||||
|
||||
// Create a Client instance
|
||||
cli := client.DefaultClient()
|
||||
|
||||
// Create a Schema instance
|
||||
schema, err := cli.Schema()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Create an Index instance
|
||||
index, err := schema.Index("repository")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Create a Field instance
|
||||
stargazer, err := index.Field("stargazer")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Sync the schema with the server-side, so non-existing indexes/fields are created on the server-side.
|
||||
err = cli.SyncSchema(schema)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Execute a query
|
||||
response, err := cli.Query(stargazer.Row(5))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Act on the result
|
||||
fmt.Println(response.Result())
|
||||
|
||||
See also https://www.pilosa.com/docs/api-reference/ and https://www.pilosa.com/docs/query-language/.
|
||||
*/
|
||||
package client
|
||||
152
client/docs/data-model-queries.md
Normal file
152
client/docs/data-model-queries.md
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
# Data Model and Queries
|
||||
|
||||
## Indexes and Fields
|
||||
|
||||
*Index* and *field*s are the main data models of Pilosa. You can check the [Pilosa documentation](https://www.pilosa.com/docs/latest/data-model/) for more detail about the data model.
|
||||
|
||||
The `schema.Index` function is used to create an index instance. Note that this does not create an index on the server; the index object simply defines the schema.
|
||||
|
||||
```go
|
||||
schema := client.NewSchema()
|
||||
repository := schema.Index("repository")
|
||||
```
|
||||
|
||||
You can pass options while creating index instances:
|
||||
```go
|
||||
repository := schema.Index("repository", pilosa.OptIndexKeys(true))
|
||||
```
|
||||
|
||||
Field definitions are created with a call to the `Field` function of an index:
|
||||
|
||||
```go
|
||||
stargazer := repository.Field("stargazer")
|
||||
```
|
||||
|
||||
You can pass options to fields:
|
||||
|
||||
```go
|
||||
stargazer := repository.Field("stargazer", pilosa.OptFieldTypeTime(TimeQuantumYearMonthDay))
|
||||
```
|
||||
|
||||
In case the schema already exists on the server, you can retrieve that instead of creating the schema:
|
||||
```go
|
||||
cli := client.DefaultClient()
|
||||
schema, err := cli.Schema()
|
||||
if err != nil {
|
||||
// act on the error
|
||||
}
|
||||
repository := schema.Index("repository")
|
||||
```
|
||||
|
||||
## Queries
|
||||
|
||||
Once you have indexes and field definitions, you can create queries for them. Some of the queries work on the columns; corresponding methods are attached to the index. Other queries work on rows with related methods attached to fields.
|
||||
|
||||
For instance, `Row` queries work on rows; use a `Field` object to create those queries:
|
||||
|
||||
```go
|
||||
rowQuery := stargazer.Row(1) // corresponds to PQL: Row(stargazer=1)
|
||||
```
|
||||
|
||||
`Union` queries work on columns; use the index to create them:
|
||||
|
||||
```go
|
||||
query := repository.Union(rowQuery1, rowQuery2)
|
||||
```
|
||||
|
||||
In order to increase throughput, you may want to batch queries sent to the Pilosa server. The `index.BatchQuery` function is used for that purpose:
|
||||
|
||||
```go
|
||||
query := repository.BatchQuery(
|
||||
stargazer.Row(1),
|
||||
repository.Union(stargazer.Row(100), stargazer.Row(5)))
|
||||
```
|
||||
|
||||
The recommended way of creating query instances is using dedicated functions attached to index and field objects, but sometimes it would be desirable to send raw queries to Pilosa. You can use `index.RawQuery` method for that. Note that query string is not validated before sending to the server:
|
||||
|
||||
```go
|
||||
query := repository.RawQuery("Row(stargazer=5)")
|
||||
```
|
||||
|
||||
Raw queries are only sent to the coordinator node of a Pilosa cluster, so currently there's a possible performance hit using them instead of ORM functions attached to index or field instances.
|
||||
|
||||
This client supports [range queries using bit sliced indexes (BSI)](https://www.pilosa.com/docs/latest/query-language/#range-bsi). Read the [Range Encoded Bitmaps](https://www.pilosa.com/blog/range-encoded-bitmaps/) blog post for more information about the BSI implementation of range encoding in Pilosa.
|
||||
|
||||
In order to use BSI range queries, an integer field should be created. The field should have its minimum and maximum set. Here's how you would do that:
|
||||
```go
|
||||
index := schema.Index("animals")
|
||||
captivity := index.Field("captivity", pilosa.OptFieldTypeInt(0, 956))
|
||||
```
|
||||
|
||||
If the field with the necessary field already exists on the server, you don't need to create the field instance, `cli.SyncSchema(schema)` would load that to `schema`. You can then add some data:
|
||||
```go
|
||||
// Add the captivity values to the field.
|
||||
data := []int{3, 392, 47, 956, 219, 14, 47, 504, 21, 0, 123, 318}
|
||||
query := index.BatchQuery()
|
||||
for i, x := range data {
|
||||
column := uint64(i + 1)
|
||||
query.Add(captivity.SetIntValue(column, x))
|
||||
}
|
||||
cli.Query(query)
|
||||
```
|
||||
|
||||
Let's write a range query:
|
||||
```go
|
||||
// Query for all animals with more than 100 specimens
|
||||
response, _ := cli.Query(captivity.GT(100))
|
||||
fmt.Println(response.Result().Row().Columns)
|
||||
|
||||
// Query for the total number of animals in captivity
|
||||
response, _ = cli.Query(captivity.Sum(nil))
|
||||
fmt.Println(response.Result().Value())
|
||||
```
|
||||
|
||||
If you pass a row query to `Sum` as a filter, then only the columns matching the filter will be considered in the `Sum` calculation:
|
||||
```go
|
||||
// Let's run a few set queries first
|
||||
cli.Query(index.BatchQuery(
|
||||
field.Set(42, 1),
|
||||
field.Set(42, 6)))
|
||||
// Query for the total number of animals in captivity where row 42 is set
|
||||
response, _ = cli.Query(captivity.Sum(field.Row(42)))
|
||||
fmt.Println(response.Result().Value())
|
||||
```
|
||||
|
||||
See the functions further below for the list of functions that can be used with a `Field`.
|
||||
|
||||
Please check [Pilosa documentation](https://www.pilosa.com/docs) for PQL details. Here is a list of methods corresponding to PQL calls:
|
||||
|
||||
Index:
|
||||
|
||||
* `Union(rows *PQLRowQuery...) *PQLRowQuery`
|
||||
* `Intersect(rows *PQLRowQuery...) *PQLRowQuery`
|
||||
* `Difference(rows *PQLRowQuery...) *PQLRowQuery`
|
||||
* `Xor(rows ...*PQLRowQuery) *PQLRowQuery`
|
||||
* `Not(row) *PQLRowQuery`
|
||||
* `Count(row *PQLRowQuery) *PQLBaseQuery`
|
||||
* `SetColumnAttrs(columnID uint64, attrs map[string]interface{}) *PQLBaseQuery`
|
||||
* `Options(row *PQLRowQuery, opts ...OptionsOption) *PQLBaseQuery`
|
||||
|
||||
Field:
|
||||
|
||||
* `Row(rowID uint64) *PQLRowQuery`
|
||||
* `Set(rowID uint64, columnID uint64) *PQLBaseQuery`
|
||||
* `SetTimestamp(rowID uint64, columnID uint64, timestamp time.Time) *PQLBaseQuery`
|
||||
* `Clear(rowID uint64, columnID uint64) *PQLBaseQuery`
|
||||
* `TopN(n uint64) *PQLRowQuery`
|
||||
* `RowTopN(n uint64, row *PQLRowQuery) *PQLRowQuery`
|
||||
* `FilterFieldTopN(n uint64, row *PQLRowQuery, field string, values ...interface{}) *PQLRowQuery`
|
||||
* `Range(rowID uint64, start time.Time, end time.Time) *PQLRowQuery`
|
||||
* `RowRange(rowID uint64, start time.Time, end time.Time) *PQLRowQuery`
|
||||
* `SetRowAttrs(rowID uint64, attrs map[string]interface{}) *PQLBaseQuery`
|
||||
* `ClearRow(rowIDOrKey interface{}) *PQLBaseQuery`
|
||||
* `Store(row *PQLRowQuery, rowIDOrKey interface{}) *PQLBaseQuery`
|
||||
* `LT(n int) *PQLRowQuery`
|
||||
* `LTE(n int) *PQLRowQuery`
|
||||
* `GT(n int) *PQLRowQuery`
|
||||
* `GTE(n int) *PQLRowQuery`
|
||||
* `Between(a int, b int) *PQLRowQuery`
|
||||
* `Sum(row *PQLRowQuery) *PQLBaseQuery`
|
||||
* `Min(row *PQLRowQuery) *PQLBaseQuery`
|
||||
* `Max(row *PQLRowQuery) *PQLBaseQuery`
|
||||
* `SetIntValue(columnID uint64, value int) *PQLBaseQuery`
|
||||
178
client/docs/server-interaction.md
Normal file
178
client/docs/server-interaction.md
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
# Server Interaction
|
||||
|
||||
## Pilosa URI
|
||||
|
||||
A Pilosa URI has the `${SCHEME}://${HOST}:${PORT}` format:
|
||||
* **Scheme**: Protocol of the URI. Default: `http`.
|
||||
* **Host**: Hostname or ipv4/ipv6 IP address. Default: localhost.
|
||||
* **Port**: Port number. Default: `10101`.
|
||||
|
||||
All parts of the URI are optional, but at least one of them must be specified. The following are equivalent:
|
||||
|
||||
* `http://localhost:10101`
|
||||
* `http://localhost`
|
||||
* `http://:10101`
|
||||
* `localhost:10101`
|
||||
* `localhost`
|
||||
* `:10101`
|
||||
|
||||
A Pilosa URI is represented by the `github.com/pilosa/pilosa/v2/net URI` struct. Below are a few ways to create `URI` objects:
|
||||
|
||||
```go
|
||||
import pnet "github.com/pilosa/pilosa/v2/net"
|
||||
|
||||
// create the default URI: http://localhost:10101
|
||||
uri1 := pnet.DefaultURI()
|
||||
|
||||
// create a URI from string address
|
||||
uri2, err := pnet.NewURIFromAddress("index1.pilosa.com:20202");
|
||||
|
||||
// create a URI with the given host and port
|
||||
uri3, err := pnet.NewURIFromHostPort("index1.pilosa.com", 20202);
|
||||
```
|
||||
|
||||
## Pilosa Client
|
||||
|
||||
In order to interact with a Pilosa server, an instance of `client.Client` should be created. The client is thread-safe and uses a pool of connections to the server, so we recommend creating a single instance of the client and sharing it when necessary.
|
||||
|
||||
If the Pilosa server is running at the default address (`http://localhost:10101`) you can create the client with default options using:
|
||||
|
||||
```go
|
||||
import "github.com/pilosa/pilosa/v2/client"
|
||||
|
||||
cli := client.DefaultClient()
|
||||
```
|
||||
|
||||
To use a custom server address, use the `NewClient` function:
|
||||
|
||||
```go
|
||||
uri, err := pnet.NewURIFromAddress("http://index1.pilosa.com:15000")
|
||||
if err != nil {
|
||||
// Act on the error
|
||||
}
|
||||
cli, err := client.NewClient(uri)
|
||||
```
|
||||
|
||||
Equivalently:
|
||||
```go
|
||||
cli, err := client.NewClient("http://index1.pilosa.com:15000")
|
||||
```
|
||||
|
||||
If you are running a cluster of Pilosa servers, you can create a `Cluster` struct that keeps addresses of those servers:
|
||||
|
||||
```go
|
||||
uri1, err := pnet.NewURIFromAddress(":10101")
|
||||
uri2, err := pnet.NewURIFromAddress(":10110")
|
||||
uri3, err := pnet.NewURIFromAddress(":10111")
|
||||
cluster := client.NewClusterWithHost(uri1, uri2, uri3)
|
||||
|
||||
// Create a client with the cluster
|
||||
cli, err := client.NewClient(cluster)
|
||||
```
|
||||
|
||||
That is equivalent to:
|
||||
```go
|
||||
cli, err := client.NewClient([]string{":10101", ":10110", ":10111"})
|
||||
|
||||
```
|
||||
|
||||
It is possible to customize the behaviour of the underlying HTTP client by passing `ClientOption` structs to the `NewClient` function:
|
||||
|
||||
```go
|
||||
cli, err := client.NewClient(cluster,
|
||||
client.OptClientConnectTimeout(1000), // if can't connect in a second, close the connection
|
||||
client.OptClientSocketTimeout(10000), // if no response received in 10 seconds, close the connection
|
||||
client.OptClientPoolSizePerRoute(3), // number of connections in the pool per host
|
||||
client.OptClientTotalPoolSize(10)) // number of total connections in the pool
|
||||
```
|
||||
|
||||
Once you create a client, you can create indexes, fields or start sending queries.
|
||||
|
||||
Here is how you would create a index and field:
|
||||
|
||||
```go
|
||||
// materialize repository index definition and stargazer field definition initialized before
|
||||
err := cli.SyncSchema(schema)
|
||||
```
|
||||
|
||||
You can send queries to a Pilosa server using the `Query` function of the `Client` struct:
|
||||
|
||||
```go
|
||||
response, err := cli.Query(field.Row(5));
|
||||
```
|
||||
|
||||
`Query` accepts zero or more options:
|
||||
|
||||
```go
|
||||
response, err := cli.Query(field.Row(5), pilosa.ColumnAttrs(true), pilosa.ExcludeColumns(true))
|
||||
```
|
||||
|
||||
## Server Response
|
||||
|
||||
When a query is sent to a Pilosa server, the server either fulfills the query or sends an error message. In the case of an error, a `pilosa.Error` struct is returned, otherwise a `QueryResponse` struct is returned.
|
||||
|
||||
A `QueryResponse` struct may contain zero or more results of `QueryResult` type. You can access all results using the `Results` function of `QueryResponse` (which returns a list of `QueryResult` objects), or you can use the `Result` method (which returns either the first result or `nil` if there are no results):
|
||||
|
||||
```go
|
||||
response, err := cli.Query(field.Row(5))
|
||||
if err != nil {
|
||||
// Act on the error
|
||||
}
|
||||
|
||||
// check that there's a result and act on it
|
||||
result := response.Result()
|
||||
if result != nil {
|
||||
// Act on the result
|
||||
}
|
||||
|
||||
// iterate over all results
|
||||
for _, result := range response.Results() {
|
||||
// Act on the result
|
||||
}
|
||||
```
|
||||
|
||||
Similarly, a `QueryResponse` struct may include a number of column attributes if `ColumnAttrs` query option was set to `true`:
|
||||
|
||||
```go
|
||||
var column *pilosa.ColumnItem
|
||||
|
||||
// iterate over all columns
|
||||
for _, column = range response.ColumnAttrs() {
|
||||
// Act on the column item
|
||||
}
|
||||
```
|
||||
|
||||
`QueryResult` objects contain:
|
||||
|
||||
* `Row()` function to retrieve a row result,
|
||||
* `CountItems()` function to retrieve column count per row ID entries returned from `TopN` queries,
|
||||
* `Count()` function to retrieve the number of rows per the given row ID returned from `Count` queries.
|
||||
* `Value()` function to retrieve the result of `Min`, `Max` or `Sum` queries.
|
||||
* `Changed()` function returns whether a `Set` or `Clear` query changed a column.
|
||||
|
||||
```go
|
||||
row := result.Row()
|
||||
columns := row.Columns
|
||||
attributes := row.Attributes
|
||||
|
||||
countItems := result.CountItems()
|
||||
|
||||
count := result.Count()
|
||||
|
||||
value := result.Value()
|
||||
|
||||
changed := result.Changed()
|
||||
```
|
||||
|
||||
## SSL/TLS
|
||||
|
||||
Make sure the Pilosa server runs on a TLS address. [How To Set Up a Secure Cluster](https://www.pilosa.com/docs/latest/tutorials/#how-to-set-up-a-secure-cluster) tutorial explains how to do that.
|
||||
|
||||
In order to enable TLS support on the client side, the scheme of the address should be explicitly specified as `https`, e.g.: `https://01.pilosa.local:10501`
|
||||
|
||||
This client library uses the `net/http` module of Go standard library. You can pass a [tls.Config](https://golang.org/pkg/crypto/tls/#Config) struct in a `pilosa.TLSConfig` option to the client. If the Pilosa server is using a certificate from a recognized authority, you can use the defaults.
|
||||
|
||||
If you are using a self signed certificate, just pass `pilosa.TLSConfig(&tls.Config{InsecureSkipVerify: true})` to `pilosa.NewClient` function:
|
||||
```go
|
||||
client, _ := pilosa.NewClient("https://01.pilosa.local:10501", pilosa.TLSConfig(&tls.Config{InsecureSkipVerify: true}))
|
||||
```
|
||||
111
client/docs/tracing.md
Normal file
111
client/docs/tracing.md
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# Tracing
|
||||
|
||||
Pilosa client supports distributed tracing via the [OpenTracing](https://opentracing.io/) API.
|
||||
|
||||
In order to use a tracer with Go-Pilosa, you should:
|
||||
1. Create the tracer,
|
||||
2. Pass the `OptClientOption(tracer)` to `NewClient`.
|
||||
|
||||
In this document, we will be using the [Jaeger](https://www.jaegertracing.io) tracer, but OpenTracing has support for [other tracing systems](https://opentracing.io/docs/supported-tracers/).
|
||||
|
||||
## Running the Pilosa Server
|
||||
|
||||
Let's run a temporary Pilosa container:
|
||||
|
||||
$ docker run -it --rm -p 10101:10101 pilosa/pilosa:v1.2.0
|
||||
|
||||
Check that you can access Pilosa:
|
||||
|
||||
$ curl localhost:10101
|
||||
Welcome. Pilosa is running. Visit https://www.pilosa.com/docs/ for more information.
|
||||
|
||||
## Running the Jaeger Server
|
||||
|
||||
Let's run a Jaeger Server container:
|
||||
|
||||
$ docker run -it --rm -p 5775:5775/udp -p 16686:16686 jaegertracing/all-in-one:latest
|
||||
...<title>Jaeger UI</title>...
|
||||
|
||||
## Writing the Sample Code
|
||||
|
||||
The sample code depdends on the Jaeger Go client, so let's install it first:
|
||||
|
||||
$ go get -u github.com/uber/jaeger-client-go/
|
||||
|
||||
Save the following sample code as `gopilosa-tracing.go`:
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
"github.com/uber/jaeger-client-go"
|
||||
"github.com/uber/jaeger-client-go/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Create the tracer.
|
||||
cfg := config.Configuration{
|
||||
Sampler: &config.SamplerConfig{
|
||||
Type: "const",
|
||||
Param: 1,
|
||||
},
|
||||
Reporter: &config.ReporterConfig{
|
||||
LogSpans: true,
|
||||
BufferFlushInterval: 1 * time.Second,
|
||||
// Jaeger Server address
|
||||
LocalAgentHostPort: "127.0.0.1:5775",
|
||||
},
|
||||
}
|
||||
tracer, closer, err := cfg.New(
|
||||
"go_pilosa_test",
|
||||
config.Logger(jaeger.StdLogger),
|
||||
)
|
||||
|
||||
// Don't forget to close the tracer.
|
||||
defer closer.Close()
|
||||
|
||||
// Create the client, and pass the tracer.
|
||||
cli, err := client.NewClient(":10101", pilosa.OptClientTracer(tracer))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Read the schema from the server.
|
||||
// This should create a trace on the Jaeger server.
|
||||
schema, err := cli.Schema()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Create and sync the sample schema.
|
||||
// This should create a trace on the Jaeger server.
|
||||
myIndex := schema.Index("my-index")
|
||||
myField := myIndex.Field("my-field")
|
||||
err = cli.SyncSchema(schema)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Run a query on Pilosa.
|
||||
// This should create a trace on the Jaeger server.
|
||||
_, err = cli.Query(myField.Set(1, 1000))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Checking the Tracing Data
|
||||
|
||||
Run the sample code:
|
||||
|
||||
$ go run gopilosa-tracing.go
|
||||
|
||||
|
||||
* Open http://localhost:16686 in your web browser to visit Jaeger UI.
|
||||
* Click on the *Search* tab and select `go_pilosa_test` in the *Service* dropdown on the right.
|
||||
* Click on *Find Traces* button at the bottom left.
|
||||
* You should see a couple of traces, such as: `Client.Query`, `Client.CreateField`, `Client.Schema`, etc.
|
||||
123
client/egpool/egpool.go
Normal file
123
client/egpool/egpool.go
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 egpool
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Group struct {
|
||||
PoolSize int
|
||||
|
||||
jobs chan func() error
|
||||
|
||||
sema chan struct{}
|
||||
errMu sync.Mutex
|
||||
firstErr error
|
||||
errs []error
|
||||
}
|
||||
|
||||
func (eg *Group) Go(f func() error) {
|
||||
if eg.PoolSize <= 0 {
|
||||
eg.PoolSize = 1
|
||||
}
|
||||
|
||||
if eg.jobs == nil {
|
||||
eg.jobs = make(chan func() error)
|
||||
eg.sema = make(chan struct{}, eg.PoolSize)
|
||||
}
|
||||
|
||||
// Start the job in an idle worker if possible.
|
||||
select {
|
||||
case eg.jobs <- f:
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
||||
// Start a new worker if necessary.
|
||||
select {
|
||||
case eg.jobs <- f:
|
||||
// A worker finished its previous job and took this one over.
|
||||
return
|
||||
case eg.sema <- struct{}{}:
|
||||
// Start a new worker.
|
||||
go eg.processJobs()
|
||||
eg.jobs <- f
|
||||
}
|
||||
}
|
||||
|
||||
func (eg *Group) err(err error) {
|
||||
eg.errMu.Lock()
|
||||
defer eg.errMu.Unlock()
|
||||
|
||||
if eg.firstErr == nil {
|
||||
eg.firstErr = err
|
||||
}
|
||||
eg.errs = append(eg.errs, err)
|
||||
}
|
||||
|
||||
type ErrPanic struct {
|
||||
Value interface{}
|
||||
}
|
||||
|
||||
func (p ErrPanic) Error() string {
|
||||
return fmt.Sprintf("panic: %v", p.Value)
|
||||
}
|
||||
|
||||
var ErrGoexit = errors.New("runtime.Goexit used in job function")
|
||||
|
||||
func (eg *Group) processJobs() {
|
||||
// Notify pool of shutdown.
|
||||
defer func() { <-eg.sema }()
|
||||
|
||||
// Handle panic and Goexit.
|
||||
var finished bool
|
||||
defer func() {
|
||||
if !finished {
|
||||
if p := recover(); p != nil {
|
||||
eg.err(ErrPanic{p})
|
||||
} else {
|
||||
eg.err(ErrGoexit)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
// Run jobs from queue.
|
||||
for jobFn := range eg.jobs {
|
||||
err := jobFn()
|
||||
if err != nil {
|
||||
eg.err(err)
|
||||
}
|
||||
}
|
||||
|
||||
finished = true
|
||||
}
|
||||
|
||||
func (eg *Group) Wait() error {
|
||||
if eg.jobs == nil {
|
||||
return nil
|
||||
}
|
||||
close(eg.jobs)
|
||||
for i := 0; i < eg.PoolSize; i++ {
|
||||
eg.sema <- struct{}{}
|
||||
}
|
||||
return eg.firstErr
|
||||
}
|
||||
|
||||
func (eg *Group) Errors() []error {
|
||||
return eg.errs
|
||||
}
|
||||
50
client/egpool/egpool_test.go
Normal file
50
client/egpool/egpool_test.go
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 egpool_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client/egpool"
|
||||
)
|
||||
|
||||
func TestEGPool(t *testing.T) {
|
||||
eg := egpool.Group{}
|
||||
|
||||
a := make([]int, 10)
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
i := i
|
||||
eg.Go(func() error {
|
||||
a[i] = i
|
||||
if i == 7 {
|
||||
return errors.New("blah")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
err := eg.Wait()
|
||||
if err == nil || err.Error() != "blah" {
|
||||
t.Errorf("expected err blah, got: %v", err)
|
||||
}
|
||||
|
||||
for i := 0; i < 10; i++ {
|
||||
if a[i] != i {
|
||||
t.Errorf("expected a[%d] to be %d, but is %d", i, i, a[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
38
client/error.go
Normal file
38
client/error.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 client
|
||||
|
||||
import "github.com/pkg/errors"
|
||||
|
||||
// Predefined Pilosa errors.
|
||||
var (
|
||||
ErrEmptyCluster = errors.New("No usable addresses in the cluster")
|
||||
ErrIndexExists = errors.New("Index exists")
|
||||
ErrFieldExists = errors.New("Field exists")
|
||||
ErrInvalidIndexName = errors.New("Invalid index name")
|
||||
ErrInvalidFieldName = errors.New("Invalid field name")
|
||||
ErrInvalidLabel = errors.New("Invalid label")
|
||||
ErrInvalidKey = errors.New("Invalid key")
|
||||
ErrTriedMaxHosts = errors.New("Tried max hosts, still failing")
|
||||
ErrAddrURIClusterExpected = errors.New("Addresses, URIs or a cluster is expected")
|
||||
ErrInvalidQueryOption = errors.New("Invalid query option")
|
||||
ErrInvalidIndexOption = errors.New("Invalid index option")
|
||||
ErrInvalidFieldOption = errors.New("Invalid field option")
|
||||
ErrNoFragmentNodes = errors.New("No fragment nodes")
|
||||
ErrNoShard = errors.New("Index has no shards")
|
||||
ErrUnknownType = errors.New("Unknown type")
|
||||
ErrSingleServerAddressRequired = errors.New("OptClientManualServerAddress requires a single URI or address")
|
||||
ErrPreconditionFailed = errors.New("Precondition failed")
|
||||
)
|
||||
45
client/logimport.go
Normal file
45
client/logimport.go
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 client
|
||||
|
||||
import (
|
||||
"encoding/gob"
|
||||
"io"
|
||||
)
|
||||
|
||||
type importLog struct {
|
||||
Index string
|
||||
Path string
|
||||
Shard uint64
|
||||
IsRoaring bool
|
||||
Timestamp int64 // Unix Nanoseconds
|
||||
Data []byte
|
||||
}
|
||||
|
||||
type encoder interface {
|
||||
Encode(thing interface{}) error
|
||||
}
|
||||
|
||||
func newImportLogEncoder(w io.Writer) encoder {
|
||||
return gob.NewEncoder(w)
|
||||
}
|
||||
|
||||
type decoder interface {
|
||||
Decode(thing interface{}) error
|
||||
}
|
||||
|
||||
func newImportLogDecoder(r io.Reader) decoder {
|
||||
return gob.NewDecoder(r)
|
||||
}
|
||||
155
client/logimport_test.go
Normal file
155
client/logimport_test.go
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEncodeDecode(t *testing.T) {
|
||||
tests := []importLog{
|
||||
{
|
||||
Index: "go-testindex",
|
||||
Path: "/index/go-testindex/field/importfield-batchsize/import?clear=false",
|
||||
Shard: 0,
|
||||
Data: make([]byte, 3918),
|
||||
},
|
||||
{
|
||||
Index: "go-testindex",
|
||||
Path: "/index/go-testindex/field/importfield-batchsize/import?clear=false",
|
||||
Shard: 0,
|
||||
Data: make([]byte, 3918),
|
||||
},
|
||||
{
|
||||
Index: "eheh",
|
||||
Path: "blah",
|
||||
Shard: 9,
|
||||
Data: []byte("something"),
|
||||
},
|
||||
{
|
||||
Index: "",
|
||||
Path: "",
|
||||
Shard: 0,
|
||||
Data: nil,
|
||||
},
|
||||
{
|
||||
Index: "eheh",
|
||||
Path: "blah",
|
||||
Shard: 10,
|
||||
Data: []byte("blahaslkdjfeoiwujf"),
|
||||
},
|
||||
{
|
||||
Index: "eheh",
|
||||
Path: "blah",
|
||||
Shard: 10,
|
||||
Data: make([]byte, 10000),
|
||||
},
|
||||
{
|
||||
Index: "zoop",
|
||||
Path: "blah",
|
||||
Shard: 8923734,
|
||||
Data: []byte("blahaslkdjfeoiwujf"),
|
||||
},
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
|
||||
nl := importLog{
|
||||
Index: test.Index,
|
||||
Path: test.Path,
|
||||
Shard: test.Shard,
|
||||
Data: make([]byte, len(test.Data)),
|
||||
}
|
||||
copy(nl.Data, test.Data)
|
||||
buf := &bytes.Buffer{}
|
||||
enc := newImportLogEncoder(buf)
|
||||
err := enc.Encode(nl)
|
||||
if err != nil {
|
||||
t.Fatalf("writing to buf: %v", err)
|
||||
}
|
||||
dec := newImportLogDecoder(buf)
|
||||
l2 := &importLog{}
|
||||
err = dec.Decode(l2)
|
||||
if err != nil {
|
||||
t.Fatalf("reading from buf: %v", err)
|
||||
}
|
||||
if l2.Index != test.Index {
|
||||
t.Errorf("indexes not equal:\n%s\n%s", test.Index, l2.Index)
|
||||
}
|
||||
if l2.Path != test.Path {
|
||||
t.Errorf("paths not equal:\n%s\n%s", test.Path, l2.Path)
|
||||
}
|
||||
if l2.Shard != test.Shard {
|
||||
t.Errorf("shards not equal exp: %d got %d", test.Shard, l2.Shard)
|
||||
}
|
||||
if !reflect.DeepEqual(test.Data, l2.Data) {
|
||||
t.Errorf("data not equal \n%v\n%v", test.Data, l2.Data)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
buf, err := ioutil.TempFile("", "")
|
||||
if err != nil {
|
||||
t.Fatalf("getting temp file: %v", err)
|
||||
}
|
||||
enc := newImportLogEncoder(buf)
|
||||
for _, test := range tests {
|
||||
a := &test
|
||||
err := enc.Encode(a)
|
||||
if err != nil {
|
||||
t.Errorf("encoding to buf: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
name := buf.Name()
|
||||
err = buf.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("closing temp file: %v", err)
|
||||
}
|
||||
|
||||
buf, err = os.Open(name)
|
||||
if err != nil {
|
||||
t.Fatalf("reopening: %v", err)
|
||||
}
|
||||
|
||||
dec := newImportLogDecoder(buf)
|
||||
for i, test := range tests {
|
||||
t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
|
||||
l := &importLog{}
|
||||
err := dec.Decode(l)
|
||||
// err := l.ReadFrom(buf)
|
||||
if err != nil {
|
||||
t.Errorf("reading from buf: %v", err)
|
||||
}
|
||||
if l.Index != test.Index {
|
||||
t.Errorf("indexes not equal:\n%s\n%s", test.Index, l.Index)
|
||||
}
|
||||
if l.Path != test.Path {
|
||||
t.Errorf("paths not equal:\n%s\n%s", test.Path, l.Path)
|
||||
}
|
||||
if l.Shard != test.Shard {
|
||||
t.Errorf("shards not equal exp: %d got %d", test.Shard, l.Shard)
|
||||
}
|
||||
if !reflect.DeepEqual(test.Data, l.Data) {
|
||||
t.Errorf("data not equal \n%v\n%v", test.Data, l.Data)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
29
client/metrics.go
Normal file
29
client/metrics.go
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 client
|
||||
|
||||
const (
|
||||
// MetricBatchImportDurationSeconds records the full time of the
|
||||
// RecordBatch.Import call. This includes starting and finishing a
|
||||
// transaction, doing key translation, building fragments locally,
|
||||
// importing all data, and resetting internal structures.
|
||||
MetricBatchImportDurationSeconds = "batch_import_duration_seconds"
|
||||
|
||||
// MetricBatchFlushDurationSeconds records the full time for
|
||||
// RecordBatch.Flush (if splitBatchMode is in use). This includes
|
||||
// starting and finishing a transaction, importing all data, and
|
||||
// resetting internal structures.
|
||||
MetricBatchFlushDurationSeconds = "batch_flush_duration_seconds"
|
||||
)
|
||||
1613
client/orm.go
Normal file
1613
client/orm.go
Normal file
File diff suppressed because it is too large
Load diff
1242
client/orm_test.go
Normal file
1242
client/orm_test.go
Normal file
File diff suppressed because it is too large
Load diff
75
client/record.go
Normal file
75
client/record.go
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
// Record is a Column or a FieldValue.
|
||||
type Record interface {
|
||||
Shard(shardWidth uint64) uint64
|
||||
Less(other Record) bool
|
||||
}
|
||||
|
||||
// RecordIterator is an iterator for a record.
|
||||
type RecordIterator interface {
|
||||
NextRecord() (Record, error)
|
||||
}
|
||||
|
||||
// Column defines a single Pilosa column.
|
||||
type Column struct {
|
||||
RowID uint64
|
||||
ColumnID uint64
|
||||
RowKey string
|
||||
ColumnKey string
|
||||
Timestamp int64
|
||||
}
|
||||
|
||||
// Shard returns the shard for this column.
|
||||
func (b Column) Shard(shardWidth uint64) uint64 {
|
||||
return b.ColumnID / shardWidth
|
||||
}
|
||||
|
||||
// Less returns true if this column sorts before the given Record.
|
||||
func (b Column) Less(other Record) bool {
|
||||
if ob, ok := other.(Column); ok {
|
||||
if b.RowID == ob.RowID {
|
||||
return b.ColumnID < ob.ColumnID
|
||||
}
|
||||
return b.RowID < ob.RowID
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// FieldValue represents the value for a column within a
|
||||
// range-encoded field.
|
||||
type FieldValue struct {
|
||||
ColumnID uint64
|
||||
ColumnKey string
|
||||
Value int64
|
||||
}
|
||||
|
||||
// Shard returns the shard for this field value.
|
||||
func (v FieldValue) Shard(shardWidth uint64) uint64 {
|
||||
return v.ColumnID / shardWidth
|
||||
}
|
||||
|
||||
// Less returns true if this field value sorts before the given Record.
|
||||
func (v FieldValue) Less(other Record) bool {
|
||||
if ov, ok := other.(FieldValue); ok {
|
||||
return v.ColumnID < ov.ColumnID
|
||||
}
|
||||
return false
|
||||
}
|
||||
83
client/record_test.go
Normal file
83
client/record_test.go
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/client"
|
||||
)
|
||||
|
||||
func TestColumnShard(t *testing.T) {
|
||||
a := client.Column{RowID: 15, ColumnID: 55, Timestamp: 100101}
|
||||
target := uint64(0)
|
||||
if a.Shard(100) != target {
|
||||
t.Fatalf("shard %d != %d", target, a.Shard(100))
|
||||
}
|
||||
target = 5
|
||||
if a.Shard(10) != target {
|
||||
t.Fatalf("shard %d != %d", target, a.Shard(10))
|
||||
}
|
||||
}
|
||||
|
||||
func TestColumnLess(t *testing.T) {
|
||||
a := client.Column{RowID: 10, ColumnID: 200}
|
||||
a2 := client.Column{RowID: 10, ColumnID: 1000}
|
||||
b := client.Column{RowID: 200, ColumnID: 10}
|
||||
c := client.FieldValue{ColumnID: 1}
|
||||
if !a.Less(a2) {
|
||||
t.Fatalf("%v should be less than %v", a, a2)
|
||||
}
|
||||
if !a.Less(b) {
|
||||
t.Fatalf("%v should be less than %v", a, b)
|
||||
}
|
||||
if b.Less(a) {
|
||||
t.Fatalf("%v should not be less than %v", b, a)
|
||||
}
|
||||
if c.Less(a) {
|
||||
t.Fatalf("%v should not be less than %v", c, a)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFieldValueShard(t *testing.T) {
|
||||
a := client.FieldValue{ColumnID: 55, Value: 125}
|
||||
target := uint64(0)
|
||||
if a.Shard(100) != target {
|
||||
t.Fatalf("shard %d != %d", target, a.Shard(100))
|
||||
}
|
||||
target = 5
|
||||
if a.Shard(10) != target {
|
||||
t.Fatalf("shard %d != %d", target, a.Shard(10))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestFieldValueLess(t *testing.T) {
|
||||
a := client.FieldValue{ColumnID: 55, Value: 125}
|
||||
b := client.FieldValue{ColumnID: 100, Value: 125}
|
||||
c := client.Column{ColumnID: 1, RowID: 2}
|
||||
if !a.Less(b) {
|
||||
t.Fatalf("%v should be less than %v", a, b)
|
||||
}
|
||||
if b.Less(a) {
|
||||
t.Fatalf("%v should not be less than %v", b, a)
|
||||
}
|
||||
if c.Less(a) {
|
||||
t.Fatalf("%v should not be less than %v", c, a)
|
||||
}
|
||||
}
|
||||
595
client/response.go
Normal file
595
client/response.go
Normal file
|
|
@ -0,0 +1,595 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/pb"
|
||||
)
|
||||
|
||||
// QueryResponse types.
|
||||
const (
|
||||
QueryResultTypeNil uint32 = iota
|
||||
QueryResultTypeRow
|
||||
QueryResultTypePairs
|
||||
QueryResultTypePairsField
|
||||
QueryResultTypeValCount
|
||||
QueryResultTypeUint64
|
||||
QueryResultTypeBool
|
||||
QueryResultTypeRowIDs // this is not used by the client
|
||||
QueryResultTypeGroupCounts
|
||||
QueryResultTypeRowIdentifiers
|
||||
QueryResultTypePair
|
||||
QueryResultTypePairField
|
||||
QueryResultTypeSignedRow
|
||||
)
|
||||
|
||||
// QueryResponse represents the response from a Pilosa query.
|
||||
type QueryResponse struct {
|
||||
ResultList []QueryResult `json:"results,omitempty"`
|
||||
ColumnList []ColumnItem `json:"columns,omitempty"`
|
||||
ErrorMessage string `json:"error-message,omitempty"`
|
||||
Success bool `json:"success,omitempty"`
|
||||
}
|
||||
|
||||
func newQueryResponseFromInternal(response *pb.QueryResponse) (*QueryResponse, error) {
|
||||
if response.Err != "" {
|
||||
return &QueryResponse{
|
||||
ErrorMessage: response.Err,
|
||||
Success: false,
|
||||
}, nil
|
||||
}
|
||||
results := make([]QueryResult, 0, len(response.Results))
|
||||
for _, r := range response.Results {
|
||||
result, err := newQueryResultFromInternal(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
results = append(results, result)
|
||||
}
|
||||
columns := make([]ColumnItem, 0, len(response.ColumnAttrSets))
|
||||
for _, p := range response.ColumnAttrSets {
|
||||
columnItem, err := newColumnItemFromInternal(p)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
columns = append(columns, columnItem)
|
||||
}
|
||||
|
||||
return &QueryResponse{
|
||||
ResultList: results,
|
||||
ColumnList: columns,
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Results returns all results in the response.
|
||||
func (qr *QueryResponse) Results() []QueryResult {
|
||||
return qr.ResultList
|
||||
}
|
||||
|
||||
// Result returns the first result or nil.
|
||||
func (qr *QueryResponse) Result() QueryResult {
|
||||
if len(qr.ResultList) == 0 {
|
||||
return nil
|
||||
}
|
||||
return qr.ResultList[0]
|
||||
}
|
||||
|
||||
// Columns returns all column attributes in the response.
|
||||
// *DEPRECATED*
|
||||
func (qr *QueryResponse) Columns() []ColumnItem {
|
||||
return qr.ColumnList
|
||||
}
|
||||
|
||||
// Column returns the attributes for first column.
|
||||
// *DEPRECATED*
|
||||
func (qr *QueryResponse) Column() ColumnItem {
|
||||
if len(qr.ColumnList) == 0 {
|
||||
return ColumnItem{}
|
||||
}
|
||||
return qr.ColumnList[0]
|
||||
}
|
||||
|
||||
// ColumnAttrs returns all column attributes in the response.
|
||||
func (qr *QueryResponse) ColumnAttrs() []ColumnItem {
|
||||
return qr.ColumnList
|
||||
}
|
||||
|
||||
// QueryResult represents one of the results in the response.
|
||||
type QueryResult interface {
|
||||
Type() uint32
|
||||
Row() RowResult
|
||||
CountItems() []CountResultItem
|
||||
CountItem() CountResultItem
|
||||
Count() int64
|
||||
Value() int64
|
||||
Changed() bool
|
||||
GroupCounts() []GroupCount
|
||||
RowIdentifiers() RowIdentifiersResult
|
||||
}
|
||||
|
||||
func newQueryResultFromInternal(result *pb.QueryResult) (QueryResult, error) {
|
||||
switch result.Type {
|
||||
case QueryResultTypeNil:
|
||||
return NilResult{}, nil
|
||||
case QueryResultTypeRow:
|
||||
return newRowResultFromInternal(result.Row)
|
||||
case QueryResultTypePairs:
|
||||
return countItemsFromInternal(result.Pairs), nil
|
||||
case QueryResultTypePairsField:
|
||||
return countItemsFromInternal(result.PairsField.Pairs), nil
|
||||
case QueryResultTypeValCount:
|
||||
return &ValCountResult{
|
||||
Val: result.ValCount.Val,
|
||||
Cnt: result.ValCount.Count,
|
||||
}, nil
|
||||
case QueryResultTypeUint64:
|
||||
return IntResult(result.N), nil
|
||||
case QueryResultTypeBool:
|
||||
return BoolResult(result.Changed), nil
|
||||
case QueryResultTypeRowIdentifiers:
|
||||
return &RowIdentifiersResult{
|
||||
IDs: result.RowIdentifiers.Rows,
|
||||
Keys: result.RowIdentifiers.Keys,
|
||||
}, nil
|
||||
case QueryResultTypeGroupCounts:
|
||||
return groupCountsFromInternal(result.GroupCounts), nil
|
||||
case QueryResultTypePair:
|
||||
return CountItem{CountResultItem: countItemFromInternal(result.Pairs[0])}, nil
|
||||
case QueryResultTypePairField:
|
||||
return CountItem{CountResultItem: countItemFromInternal(result.PairField.Pair)}, nil
|
||||
}
|
||||
|
||||
return nil, ErrUnknownType
|
||||
}
|
||||
|
||||
// CountResultItem represents a result from TopN call.
|
||||
type CountResultItem struct {
|
||||
ID uint64 `json:"id"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Count uint64 `json:"count"`
|
||||
}
|
||||
|
||||
func (c *CountResultItem) String() string {
|
||||
if c.Key != "" {
|
||||
return fmt.Sprintf("%s:%d", c.Key, c.Count)
|
||||
}
|
||||
return fmt.Sprintf("%d:%d", c.ID, c.Count)
|
||||
}
|
||||
|
||||
type CountItem struct {
|
||||
CountResultItem
|
||||
}
|
||||
|
||||
// Type is the type of this result.
|
||||
func (CountItem) Type() uint32 { return QueryResultTypePairField }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (CountItem) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (t CountItem) CountItems() []CountResultItem { return []CountResultItem{t.CountResultItem} }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (t CountItem) CountItem() CountResultItem { return t.CountResultItem }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (CountItem) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (CountItem) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (CountItem) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (CountItem) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (CountItem) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
func countItemFromInternal(item *pb.Pair) CountResultItem {
|
||||
return CountResultItem{ID: item.ID, Key: item.Key, Count: item.Count}
|
||||
}
|
||||
|
||||
func countItemsFromInternal(items []*pb.Pair) TopNResult {
|
||||
result := make([]CountResultItem, 0, len(items))
|
||||
for _, v := range items {
|
||||
result = append(result, countItemFromInternal(v))
|
||||
}
|
||||
return TopNResult(result)
|
||||
}
|
||||
|
||||
// TopNResult is returned from TopN call.
|
||||
type TopNResult []CountResultItem
|
||||
|
||||
// Type is the type of this result.
|
||||
func (TopNResult) Type() uint32 { return QueryResultTypePairsField }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (TopNResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (t TopNResult) CountItems() []CountResultItem { return t }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (t TopNResult) CountItem() CountResultItem {
|
||||
if len(t) >= 1 {
|
||||
return t[0]
|
||||
}
|
||||
return CountResultItem{}
|
||||
}
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (TopNResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (TopNResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (TopNResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (TopNResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (TopNResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// RowResult represents a result from Row, Union, Intersect, Difference and Range PQL calls.
|
||||
type RowResult struct {
|
||||
Attributes map[string]interface{} `json:"attrs"`
|
||||
Columns []uint64 `json:"columns"`
|
||||
Keys []string `json:"keys"`
|
||||
}
|
||||
|
||||
func newRowResultFromInternal(row *pb.Row) (*RowResult, error) {
|
||||
attrs, err := convertInternalAttrsToMap(row.Attrs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := &RowResult{
|
||||
Attributes: attrs,
|
||||
Columns: row.Columns,
|
||||
Keys: row.Keys,
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Type is the type of this result.
|
||||
func (RowResult) Type() uint32 { return QueryResultTypeRow }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (b RowResult) Row() RowResult { return b }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (RowResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (RowResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (RowResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (RowResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (RowResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (RowResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (RowResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// MarshalJSON serializes this row result.
|
||||
func (b RowResult) MarshalJSON() ([]byte, error) {
|
||||
columns := b.Columns
|
||||
if columns == nil {
|
||||
columns = []uint64{}
|
||||
}
|
||||
keys := b.Keys
|
||||
if keys == nil {
|
||||
keys = []string{}
|
||||
}
|
||||
return json.Marshal(struct {
|
||||
Attributes map[string]interface{} `json:"attrs"`
|
||||
Columns []uint64 `json:"columns"`
|
||||
Keys []string `json:"keys"`
|
||||
}{
|
||||
Attributes: b.Attributes,
|
||||
Columns: columns,
|
||||
Keys: keys,
|
||||
})
|
||||
}
|
||||
|
||||
// ValCountResult is returned from Min, Max and Sum calls.
|
||||
type ValCountResult struct {
|
||||
Val int64 `json:"val"`
|
||||
Cnt int64 `json:"count"`
|
||||
}
|
||||
|
||||
// Type is the type of this result.
|
||||
func (ValCountResult) Type() uint32 { return QueryResultTypeValCount }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (ValCountResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (ValCountResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (ValCountResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (c ValCountResult) Count() int64 { return c.Cnt }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (c ValCountResult) Value() int64 { return c.Val }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (ValCountResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (ValCountResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (ValCountResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// IntResult is returned from Count call.
|
||||
type IntResult int64
|
||||
|
||||
// Type is the type of this result.
|
||||
func (IntResult) Type() uint32 { return QueryResultTypeUint64 }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (IntResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (IntResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (IntResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (i IntResult) Count() int64 { return int64(i) }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (IntResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (IntResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (IntResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (IntResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// BoolResult is returned from Set and Clear calls.
|
||||
type BoolResult bool
|
||||
|
||||
// Type is the type of this result.
|
||||
func (BoolResult) Type() uint32 { return QueryResultTypeBool }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (BoolResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (BoolResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (BoolResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (BoolResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (BoolResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (b BoolResult) Changed() bool { return bool(b) }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (BoolResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (BoolResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// NilResult is returned from calls which don't return a value, such as SetRowAttrs.
|
||||
type NilResult struct{}
|
||||
|
||||
// Type is the type of this result.
|
||||
func (NilResult) Type() uint32 { return QueryResultTypeNil }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (NilResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (NilResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (NilResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (NilResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (NilResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (NilResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (NilResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (NilResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// FieldRow represents a Group in a GroupBy call result.
|
||||
type FieldRow struct {
|
||||
FieldName string `json:"field"`
|
||||
RowID uint64 `json:"rowID"`
|
||||
RowKey string `json:"rowKey"`
|
||||
Value *int64 `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// GroupCount contains groups and their count in a GroupBy call result.
|
||||
type GroupCount struct {
|
||||
Groups []FieldRow `json:"groups"`
|
||||
Count int64 `json:"count"`
|
||||
Agg int64 `json:"agg"`
|
||||
}
|
||||
|
||||
// GroupCountResult is returned from GroupBy call.
|
||||
type GroupCountResult []GroupCount
|
||||
|
||||
// Type is the type of this result.
|
||||
func (GroupCountResult) Type() uint32 { return QueryResultTypeGroupCounts }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (GroupCountResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (GroupCountResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (GroupCountResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (GroupCountResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (GroupCountResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (GroupCountResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (r GroupCountResult) GroupCounts() []GroupCount { return r }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (GroupCountResult) RowIdentifiers() RowIdentifiersResult { return RowIdentifiersResult{} }
|
||||
|
||||
// RowIdentifiersResult is returned from a Rows call.
|
||||
type RowIdentifiersResult struct {
|
||||
IDs []uint64 `json:"ids"`
|
||||
Keys []string `json:"keys,omitempty"`
|
||||
}
|
||||
|
||||
// Type is the type of this result.
|
||||
func (RowIdentifiersResult) Type() uint32 { return QueryResultTypeRowIdentifiers }
|
||||
|
||||
// Row returns a RowResult.
|
||||
func (RowIdentifiersResult) Row() RowResult { return RowResult{} }
|
||||
|
||||
// CountItems returns a CountResultItem slice.
|
||||
func (RowIdentifiersResult) CountItems() []CountResultItem { return nil }
|
||||
|
||||
// CountItem returns a CountResultItem
|
||||
func (RowIdentifiersResult) CountItem() CountResultItem { return CountResultItem{} }
|
||||
|
||||
// Count returns the result of a Count call.
|
||||
func (RowIdentifiersResult) Count() int64 { return 0 }
|
||||
|
||||
// Value returns the result of a Min, Max or Sum call.
|
||||
func (RowIdentifiersResult) Value() int64 { return 0 }
|
||||
|
||||
// Changed returns whether the corresponding Set or Clear call changed the value of a bit.
|
||||
func (RowIdentifiersResult) Changed() bool { return false }
|
||||
|
||||
// GroupCounts returns the result of a GroupBy call.
|
||||
func (RowIdentifiersResult) GroupCounts() []GroupCount { return nil }
|
||||
|
||||
// RowIdentifiers returns the result of a Rows call.
|
||||
func (r RowIdentifiersResult) RowIdentifiers() RowIdentifiersResult { return r }
|
||||
|
||||
func groupCountsFromInternal(items *pb.GroupCounts) GroupCountResult {
|
||||
result := make([]GroupCount, 0, len(items.Groups))
|
||||
for _, g := range items.Groups {
|
||||
groups := make([]FieldRow, 0, len(g.Group))
|
||||
for _, f := range g.Group {
|
||||
fr := FieldRow{
|
||||
FieldName: f.Field,
|
||||
RowID: f.RowID,
|
||||
RowKey: f.RowKey,
|
||||
}
|
||||
if f.Value != nil {
|
||||
fr.Value = &f.Value.Value
|
||||
}
|
||||
groups = append(groups, fr)
|
||||
}
|
||||
result = append(result, GroupCount{
|
||||
Groups: groups,
|
||||
Count: int64(g.Count),
|
||||
Agg: int64(g.Agg),
|
||||
})
|
||||
}
|
||||
return GroupCountResult(result)
|
||||
}
|
||||
|
||||
const (
|
||||
stringType = 1
|
||||
intType = 2
|
||||
boolType = 3
|
||||
floatType = 4
|
||||
)
|
||||
|
||||
func convertInternalAttrsToMap(attrs []*pb.Attr) (attrsMap map[string]interface{}, err error) {
|
||||
attrsMap = make(map[string]interface{}, len(attrs))
|
||||
for _, attr := range attrs {
|
||||
switch attr.Type {
|
||||
case stringType:
|
||||
attrsMap[attr.Key] = attr.StringValue
|
||||
case intType:
|
||||
attrsMap[attr.Key] = attr.IntValue
|
||||
case boolType:
|
||||
attrsMap[attr.Key] = attr.BoolValue
|
||||
case floatType:
|
||||
attrsMap[attr.Key] = attr.FloatValue
|
||||
default:
|
||||
return nil, errors.New("Unknown attribute type")
|
||||
}
|
||||
}
|
||||
|
||||
return attrsMap, nil
|
||||
}
|
||||
|
||||
// ColumnItem represents data about a column.
|
||||
// Column data is only returned if QueryOptions.Columns was set to true.
|
||||
type ColumnItem struct {
|
||||
ID uint64 `json:"id,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Attributes map[string]interface{} `json:"attributes,omitempty"`
|
||||
}
|
||||
|
||||
func newColumnItemFromInternal(column *pb.ColumnAttrSet) (ColumnItem, error) {
|
||||
attrs, err := convertInternalAttrsToMap(column.Attrs)
|
||||
if err != nil {
|
||||
return ColumnItem{}, err
|
||||
}
|
||||
return ColumnItem{
|
||||
ID: column.ID,
|
||||
Key: column.Key,
|
||||
Attributes: attrs,
|
||||
}, nil
|
||||
}
|
||||
348
client/response_test.go
Normal file
348
client/response_test.go
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/pilosa/pilosa/v2/pb"
|
||||
)
|
||||
|
||||
func TestNewRowResultFromInternal(t *testing.T) {
|
||||
targetAttrs := map[string]interface{}{
|
||||
"name": "some string",
|
||||
"age": int64(95),
|
||||
"registered": true,
|
||||
"height": 1.83,
|
||||
}
|
||||
targetColumns := []uint64{5, 10}
|
||||
attrs := []*pb.Attr{
|
||||
{Key: "name", StringValue: "some string", Type: 1},
|
||||
{Key: "age", IntValue: 95, Type: 2},
|
||||
{Key: "registered", BoolValue: true, Type: 3},
|
||||
{Key: "height", FloatValue: 1.83, Type: 4},
|
||||
}
|
||||
row := &pb.Row{
|
||||
Attrs: attrs,
|
||||
Columns: []uint64{5, 10},
|
||||
}
|
||||
result, err := newRowResultFromInternal(row)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed with error: %s", err)
|
||||
}
|
||||
// assertMapEquals(t, targetAttrs, result.Attributes)
|
||||
if !reflect.DeepEqual(targetAttrs, result.Attributes) {
|
||||
t.Fatal()
|
||||
}
|
||||
if !reflect.DeepEqual(targetColumns, result.Columns) {
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewQueryResponseFromInternal(t *testing.T) {
|
||||
targetAttrs := map[string]interface{}{
|
||||
"name": "some string",
|
||||
"age": int64(95),
|
||||
"registered": true,
|
||||
"height": 1.83,
|
||||
}
|
||||
targetColumns := []uint64{5, 10}
|
||||
targetCountItems := []CountResultItem{
|
||||
{ID: 10, Count: 100},
|
||||
}
|
||||
attrs := []*pb.Attr{
|
||||
{Key: "name", StringValue: "some string", Type: 1},
|
||||
{Key: "age", IntValue: 95, Type: 2},
|
||||
{Key: "registered", BoolValue: true, Type: 3},
|
||||
{Key: "height", FloatValue: 1.83, Type: 4},
|
||||
}
|
||||
row := &pb.Row{
|
||||
Attrs: attrs,
|
||||
Columns: []uint64{5, 10},
|
||||
}
|
||||
pairs := []*pb.Pair{
|
||||
{ID: 10, Count: 100},
|
||||
}
|
||||
response := &pb.QueryResponse{
|
||||
Results: []*pb.QueryResult{
|
||||
{Type: QueryResultTypeRow, Row: row},
|
||||
{Type: QueryResultTypePairs, Pairs: pairs},
|
||||
},
|
||||
Err: "",
|
||||
}
|
||||
qr, err := newQueryResponseFromInternal(response)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed with error: %s", err)
|
||||
}
|
||||
if qr.ErrorMessage != "" {
|
||||
t.Fatalf("ErrorMessage should be empty")
|
||||
}
|
||||
if !qr.Success {
|
||||
t.Fatalf("IsSuccess should be true")
|
||||
}
|
||||
|
||||
results := qr.Results()
|
||||
if len(results) != 2 {
|
||||
t.Fatalf("Number of results should be 2")
|
||||
}
|
||||
if results[0] != qr.Result() {
|
||||
t.Fatalf("Result() should return the first result")
|
||||
}
|
||||
if !reflect.DeepEqual(targetAttrs, results[0].Row().Attributes) {
|
||||
t.Fatalf("The row result should contain the attributes")
|
||||
}
|
||||
if !reflect.DeepEqual(targetColumns, results[0].Row().Columns) {
|
||||
t.Fatalf("The row result should contain the columns")
|
||||
}
|
||||
if !reflect.DeepEqual(targetCountItems, results[1].CountItems()) {
|
||||
t.Fatalf("The response should include count items")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewQueryResponseWithErrorFromInternal(t *testing.T) {
|
||||
response := &pb.QueryResponse{
|
||||
Err: "some error",
|
||||
}
|
||||
qr, err := newQueryResponseFromInternal(response)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed with error: %s", err)
|
||||
}
|
||||
if qr.ErrorMessage != "some error" {
|
||||
t.Fatalf("The response should include the error message")
|
||||
}
|
||||
if qr.Success {
|
||||
t.Fatalf("IsSuccess should be false")
|
||||
}
|
||||
if qr.Result() != nil {
|
||||
t.Fatalf("If there are no results, Result should return nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewQueryResponseFromInternalFailure(t *testing.T) {
|
||||
attrs := []*pb.Attr{
|
||||
{Key: "name", StringValue: "some string", Type: 99},
|
||||
}
|
||||
row := &pb.Row{
|
||||
Attrs: attrs,
|
||||
}
|
||||
response := &pb.QueryResponse{
|
||||
Results: []*pb.QueryResult{{Type: QueryResultTypeRow, Row: row}},
|
||||
}
|
||||
qr, err := newQueryResponseFromInternal(response)
|
||||
if qr != nil && err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
response = &pb.QueryResponse{
|
||||
ColumnAttrSets: []*pb.ColumnAttrSet{{ID: 1, Attrs: attrs}},
|
||||
}
|
||||
qr, err = newQueryResponseFromInternal(response)
|
||||
if qr != nil && err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCountResultItemToString(t *testing.T) {
|
||||
tests := []struct {
|
||||
item *CountResultItem
|
||||
expected string
|
||||
}{
|
||||
{item: &CountResultItem{ID: 100, Count: 50}, expected: "100:50"},
|
||||
{item: &CountResultItem{Key: "blah", Count: 50}, expected: "blah:50"},
|
||||
{item: &CountResultItem{Key: "blah", ID: 22, Count: 50}, expected: "blah:50"},
|
||||
{item: &CountResultItem{Key: "blah", ID: 22}, expected: "blah:0"},
|
||||
{item: &CountResultItem{}, expected: "0:0"},
|
||||
}
|
||||
|
||||
for i, tst := range tests {
|
||||
t.Run(fmt.Sprintf("%d: ", i), func(t *testing.T) {
|
||||
if tst.expected != tst.item.String() {
|
||||
t.Fatalf("%s != %s", tst.expected, tst.item.String())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMarshalResults(t *testing.T) {
|
||||
attrs := []*pb.Attr{
|
||||
{Key: "name", StringValue: "some string", Type: 1},
|
||||
{Key: "age", IntValue: 95, Type: 2},
|
||||
{Key: "registered", BoolValue: true, Type: 3},
|
||||
{Key: "height", FloatValue: 1.83, Type: 4},
|
||||
}
|
||||
row := &pb.Row{
|
||||
Attrs: attrs,
|
||||
Columns: []uint64{5, 10},
|
||||
}
|
||||
pairs := []*pb.Pair{
|
||||
{ID: 10, Count: 100},
|
||||
}
|
||||
pbufResults := []*pb.QueryResult{
|
||||
{Type: QueryResultTypeRow, Row: row},
|
||||
{Type: QueryResultTypePairs, Pairs: pairs},
|
||||
}
|
||||
resultJSONStrings := make([]string, len(pbufResults))
|
||||
for i, pr := range pbufResults {
|
||||
r, err := newQueryResultFromInternal(pr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
b, err := json.Marshal(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
resultJSONStrings[i] = string(b)
|
||||
}
|
||||
targetJSON := []string{
|
||||
`{"attrs":{"age":95,"height":1.83,"name":"some string","registered":true},"columns":[5,10],"keys":[]}`,
|
||||
`[{"id":10,"count":100}]`,
|
||||
}
|
||||
for i := range targetJSON {
|
||||
if sortedString(targetJSON[i]) != sortedString(resultJSONStrings[i]) {
|
||||
t.Fatalf("%v != %v ", targetJSON[i], resultJSONStrings[i])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestUnknownQueryResultType(t *testing.T) {
|
||||
result := &pb.QueryResult{
|
||||
Type: 999,
|
||||
}
|
||||
_, err := newQueryResultFromInternal(result)
|
||||
if err != ErrUnknownType {
|
||||
t.Fatalf("Should have failed with ErrUnknownType")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTopNResult(t *testing.T) {
|
||||
result := TopNResult{
|
||||
CountResultItem{ID: 100, Count: 10},
|
||||
}
|
||||
expectResult(t, result, QueryResultTypePairsField, RowResult{}, []CountResultItem{{100, "", 10}}, 0, 0, false, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestRowResult(t *testing.T) {
|
||||
result := RowResult{
|
||||
Columns: []uint64{1, 2, 3},
|
||||
}
|
||||
targetBmp := RowResult{
|
||||
Columns: []uint64{1, 2, 3},
|
||||
}
|
||||
expectResult(t, result, QueryResultTypeRow, targetBmp, nil, 0, 0, false, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestRowResultNilColumns(t *testing.T) {
|
||||
result := RowResult{
|
||||
Columns: nil,
|
||||
}
|
||||
_, err := result.MarshalJSON()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSumCountResult(t *testing.T) {
|
||||
result := ValCountResult{
|
||||
Val: 100,
|
||||
Cnt: 50,
|
||||
}
|
||||
expectResult(t, result, QueryResultTypeValCount, RowResult{}, nil, 100, 50, false, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestIntResult(t *testing.T) {
|
||||
result := IntResult(11)
|
||||
expectResult(t, result, QueryResultTypeUint64, RowResult{}, nil, 0, 11, false, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestBoolResult(t *testing.T) {
|
||||
result := BoolResult(true)
|
||||
expectResult(t, result, QueryResultTypeBool, RowResult{}, nil, 0, 0, true, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestNilResult(t *testing.T) {
|
||||
result := NilResult{}
|
||||
expectResult(t, result, QueryResultTypeNil, RowResult{}, nil, 0, 0, false, nil, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestGroupCountResult(t *testing.T) {
|
||||
result := GroupCountResult{
|
||||
{Groups: []FieldRow{{FieldName: "f1", RowID: 1}}, Count: 2},
|
||||
{Groups: []FieldRow{{FieldName: "f1", RowID: 2}}, Count: 1},
|
||||
}
|
||||
expectResult(t, result, QueryResultTypeGroupCounts, RowResult{}, nil, 0, 0, false, []GroupCount{
|
||||
{Groups: []FieldRow{{FieldName: "f1", RowID: 1}}, Count: 2},
|
||||
{Groups: []FieldRow{{FieldName: "f1", RowID: 2}}, Count: 1},
|
||||
}, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestGroupCountWithValueResult(t *testing.T) {
|
||||
var a, b int64 = -1, 1
|
||||
|
||||
result := GroupCountResult{
|
||||
{Groups: []FieldRow{{FieldName: "f1", Value: &a}}, Count: 1},
|
||||
{Groups: []FieldRow{{FieldName: "f1", Value: &b}}, Count: 1},
|
||||
}
|
||||
|
||||
var aa, bb int64 = -1, 1
|
||||
expectResult(t, result, QueryResultTypeGroupCounts, RowResult{}, nil, 0, 0, false, []GroupCount{
|
||||
{Groups: []FieldRow{{FieldName: "f1", Value: &aa}}, Count: 1},
|
||||
{Groups: []FieldRow{{FieldName: "f1", Value: &bb}}, Count: 1},
|
||||
}, RowIdentifiersResult{})
|
||||
}
|
||||
|
||||
func TestRowIdentifiersResult(t *testing.T) {
|
||||
result := RowIdentifiersResult{
|
||||
IDs: []uint64{1, 2, 3, 4},
|
||||
}
|
||||
expectResult(t, result, QueryResultTypeRowIdentifiers, RowResult{}, nil, 0, 0, false, nil, RowIdentifiersResult{
|
||||
IDs: []uint64{1, 2, 3, 4},
|
||||
})
|
||||
}
|
||||
|
||||
func expectResult(t *testing.T, r QueryResult, resultType uint32, bmp RowResult,
|
||||
countItems []CountResultItem, sum int64, count int64, changed bool,
|
||||
groupCounts []GroupCount, rowIdentifiers RowIdentifiersResult) {
|
||||
if resultType != r.Type() {
|
||||
log.Fatalf("Result type: %d != %d", resultType, r.Type())
|
||||
}
|
||||
if !reflect.DeepEqual(bmp, r.Row()) {
|
||||
log.Fatalf("Row: %v != %v", bmp, r.Row())
|
||||
}
|
||||
if !reflect.DeepEqual(countItems, r.CountItems()) {
|
||||
log.Fatalf("Count items: %v != %v", countItems, r.CountItems())
|
||||
}
|
||||
if count != r.Count() {
|
||||
log.Fatalf("Count: %d != %d", count, r.Count())
|
||||
}
|
||||
if sum != r.Value() {
|
||||
log.Fatalf("Sum: %d != %d", sum, r.Value())
|
||||
}
|
||||
if changed != r.Changed() {
|
||||
log.Fatalf("Changed: %v != %v", changed, r.Changed())
|
||||
}
|
||||
if !reflect.DeepEqual(groupCounts, r.GroupCounts()) {
|
||||
log.Fatalf("Group counts: %v != %v", groupCounts, r.GroupCounts())
|
||||
}
|
||||
if !reflect.DeepEqual(rowIdentifiers, r.RowIdentifiers()) {
|
||||
log.Fatalf("Row identifiers: %v != %v", rowIdentifiers, r.RowIdentifiers())
|
||||
}
|
||||
}
|
||||
66
client/shardnodes.go
Normal file
66
client/shardnodes.go
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
)
|
||||
|
||||
type shardNodes struct {
|
||||
data map[string]map[uint64][]*pnet.URI
|
||||
mu *sync.RWMutex
|
||||
}
|
||||
|
||||
func newShardNodes() shardNodes {
|
||||
return shardNodes{
|
||||
data: make(map[string]map[uint64][]*pnet.URI),
|
||||
mu: &sync.RWMutex{},
|
||||
}
|
||||
}
|
||||
|
||||
func (s shardNodes) Get(index string, shard uint64) ([]*pnet.URI, bool) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
if idx, ok := s.data[index]; ok {
|
||||
if uris, ok := idx[shard]; ok {
|
||||
return uris, true
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (s shardNodes) Put(index string, shard uint64, uris []*pnet.URI) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
idx, ok := s.data[index]
|
||||
if !ok {
|
||||
idx = make(map[uint64][]*pnet.URI)
|
||||
}
|
||||
idx[shard] = uris
|
||||
s.data[index] = idx
|
||||
}
|
||||
|
||||
func (s shardNodes) Invalidate() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
for k := range s.data {
|
||||
delete(s.data, k)
|
||||
}
|
||||
}
|
||||
89
client/tracer.go
Normal file
89
client/tracer.go
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
opentracing "github.com/opentracing/opentracing-go"
|
||||
"github.com/opentracing/opentracing-go/log"
|
||||
)
|
||||
|
||||
type NoopTracer struct{}
|
||||
|
||||
type NoopSpan struct{}
|
||||
|
||||
func (s NoopSpan) Finish() {
|
||||
// pass
|
||||
}
|
||||
func (s NoopSpan) FinishWithOptions(opts opentracing.FinishOptions) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (s NoopSpan) Context() opentracing.SpanContext {
|
||||
return nil
|
||||
}
|
||||
func (s NoopSpan) SetOperationName(operationName string) opentracing.Span {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s NoopSpan) SetTag(key string, value interface{}) opentracing.Span {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s NoopSpan) LogFields(fields ...log.Field) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (s NoopSpan) LogKV(alternatingKeyValues ...interface{}) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (s NoopSpan) SetBaggageItem(restrictedKey, value string) opentracing.Span {
|
||||
return s
|
||||
}
|
||||
|
||||
func (s NoopSpan) BaggageItem(restrictedKey string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (s NoopSpan) Tracer() opentracing.Tracer {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s NoopSpan) LogEvent(event string) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (s NoopSpan) LogEventWithPayload(event string, payload interface{}) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (s NoopSpan) Log(data opentracing.LogData) {
|
||||
// pass
|
||||
}
|
||||
|
||||
func (t NoopTracer) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span {
|
||||
return NoopSpan{}
|
||||
}
|
||||
|
||||
func (t NoopTracer) Inject(sm opentracing.SpanContext, format interface{}, carrier interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t NoopTracer) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error) {
|
||||
return nil, nil
|
||||
}
|
||||
54
client/validate.go
Normal file
54
client/validate.go
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
)
|
||||
|
||||
const (
|
||||
maxLabel = 64
|
||||
maxKey = 64
|
||||
)
|
||||
|
||||
var labelRegex = regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9_-]*$")
|
||||
var keyRegex = regexp.MustCompile("^[A-Za-z0-9_{}+/=.~%:-]*$")
|
||||
|
||||
// ValidLabel returns true if the given label is valid, otherwise false.
|
||||
func ValidLabel(label string) bool {
|
||||
return len(label) <= maxLabel && labelRegex.Match([]byte(label))
|
||||
}
|
||||
|
||||
// ValidKey returns true if the given key is valid, otherwise false.
|
||||
func ValidKey(key string) bool {
|
||||
return len(key) <= maxKey && keyRegex.Match([]byte(key))
|
||||
}
|
||||
|
||||
func validateLabel(label string) error {
|
||||
if ValidLabel(label) {
|
||||
return nil
|
||||
}
|
||||
return ErrInvalidLabel
|
||||
}
|
||||
|
||||
func validateKey(key string) error {
|
||||
if ValidKey(key) {
|
||||
return nil
|
||||
}
|
||||
return ErrInvalidKey
|
||||
}
|
||||
73
client/validate_test.go
Normal file
73
client/validate_test.go
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestValidateLabel(t *testing.T) {
|
||||
labels := []string{
|
||||
"a", "ab", "ab1", "d_e", "A", "Bc", "B1", "aB", "b-c",
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
}
|
||||
for _, label := range labels {
|
||||
if validateLabel(label) != nil {
|
||||
t.Fatalf("Should be valid label: %s", label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateLabelInvalid(t *testing.T) {
|
||||
labels := []string{
|
||||
"", "1", "_", "-", "'", "^", "/", "\\", "*", "a:b", "valid?no", "yüce",
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
|
||||
}
|
||||
for _, label := range labels {
|
||||
if validateLabel(label) == nil {
|
||||
t.Fatalf("Should be invalid label: %s", label)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateKey(t *testing.T) {
|
||||
keys := []string{
|
||||
"", "1", "ab", "ab1", "b-c", "d_e", "pilosa.com",
|
||||
"bbf8d41c-7dba-40c4-94dc-94677b43bcf3", // UUID
|
||||
"{bbf8d41c-7dba-40c4-94dc-94677b43bcf3}", // Windows GUID
|
||||
"https%3A//www.pilosa.com/about/%23contact", // escaped URL
|
||||
"aHR0cHM6Ly93d3cucGlsb3NhLmNvbS9hYm91dC8jY29udGFjdA==", // base64
|
||||
"urn:isbn:1234567",
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
}
|
||||
for _, key := range keys {
|
||||
if validateKey(key) != nil {
|
||||
t.Fatalf("Should be valid key: %s", key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateKeyInvalid(t *testing.T) {
|
||||
keys := []string{
|
||||
"\"", "'", "slice\\dice", "valid?no", "yüce", "*xyz", "with space", "<script>",
|
||||
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1",
|
||||
}
|
||||
for _, key := range keys {
|
||||
if validateKey(key) == nil {
|
||||
t.Fatalf("Should be invalid key: %s", key)
|
||||
}
|
||||
}
|
||||
}
|
||||
21
client/version.go
Normal file
21
client/version.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
package client
|
||||
|
||||
// Version is the client version.
|
||||
const Version = "v1.3.0"
|
||||
|
|
@ -32,7 +32,7 @@ import (
|
|||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/pilosa/pilosa/v2"
|
||||
"github.com/pilosa/pilosa/v2/internal"
|
||||
"github.com/pilosa/pilosa/v2/pb"
|
||||
"github.com/pilosa/pilosa/v2/roaring"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
|
@ -234,7 +234,7 @@ func (cmd *InspectCommand) Run(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// loadTopology is copied almost exactly from pilosa/cluster.go.
|
||||
func loadTopology(path string) (topology internal.Topology, myID string, err error) {
|
||||
func loadTopology(path string) (topology pb.Topology, myID string, err error) {
|
||||
buf, err := ioutil.ReadFile(filepath.Join(path, ".topology"))
|
||||
if os.IsNotExist(err) {
|
||||
return topology, myID, err
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
180
executor.go
180
executor.go
|
|
@ -30,7 +30,7 @@ import (
|
|||
|
||||
"github.com/pilosa/pilosa/v2/disco"
|
||||
"github.com/pilosa/pilosa/v2/pql"
|
||||
pb "github.com/pilosa/pilosa/v2/proto"
|
||||
"github.com/pilosa/pilosa/v2/proto"
|
||||
"github.com/pilosa/pilosa/v2/roaring"
|
||||
"github.com/pilosa/pilosa/v2/shardwidth"
|
||||
"github.com/pilosa/pilosa/v2/testhook"
|
||||
|
|
@ -2734,37 +2734,37 @@ func (r *RowIdentifiers) Clone() (clone *RowIdentifiers) {
|
|||
}
|
||||
|
||||
// ToTable implements the ToTabler interface.
|
||||
func (r RowIdentifiers) ToTable() (*pb.TableResponse, error) {
|
||||
func (r RowIdentifiers) ToTable() (*proto.TableResponse, error) {
|
||||
var n int
|
||||
if len(r.Keys) > 0 {
|
||||
n = len(r.Keys)
|
||||
} else {
|
||||
n = len(r.Rows)
|
||||
}
|
||||
return pb.RowsToTable(&r, n)
|
||||
return proto.RowsToTable(&r, n)
|
||||
}
|
||||
|
||||
// ToRows implements the ToRowser interface.
|
||||
func (r RowIdentifiers) ToRows(callback func(*pb.RowResponse) error) error {
|
||||
func (r RowIdentifiers) ToRows(callback func(*proto.RowResponse) error) error {
|
||||
if len(r.Keys) > 0 {
|
||||
ci := []*pb.ColumnInfo{{Name: r.Field(), Datatype: "string"}}
|
||||
ci := []*proto.ColumnInfo{{Name: r.Field(), Datatype: "string"}}
|
||||
for _, key := range r.Keys {
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_StringVal{StringVal: key}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_StringVal{StringVal: key}},
|
||||
}}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
}
|
||||
ci = nil
|
||||
}
|
||||
} else {
|
||||
ci := []*pb.ColumnInfo{{Name: r.Field(), Datatype: "uint64"}}
|
||||
ci := []*proto.ColumnInfo{{Name: r.Field(), Datatype: "uint64"}}
|
||||
for _, id := range r.Rows {
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: uint64(id)}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Uint64Val{Uint64Val: uint64(id)}},
|
||||
}}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
}
|
||||
|
|
@ -3282,50 +3282,50 @@ func NewGroupCounts(agg string, groups ...GroupCount) *GroupCounts {
|
|||
}
|
||||
|
||||
// ToTable implements the ToTabler interface.
|
||||
func (g *GroupCounts) ToTable() (*pb.TableResponse, error) {
|
||||
return pb.RowsToTable(g, len(g.Groups()))
|
||||
func (g *GroupCounts) ToTable() (*proto.TableResponse, error) {
|
||||
return proto.RowsToTable(g, len(g.Groups()))
|
||||
}
|
||||
|
||||
// ToRows implements the ToRowser interface.
|
||||
func (g *GroupCounts) ToRows(callback func(*pb.RowResponse) error) error {
|
||||
func (g *GroupCounts) ToRows(callback func(*proto.RowResponse) error) error {
|
||||
agg := g.AggregateColumn()
|
||||
for i, gc := range g.Groups() {
|
||||
var ci []*pb.ColumnInfo
|
||||
var ci []*proto.ColumnInfo
|
||||
if i == 0 {
|
||||
for _, fieldRow := range gc.Group {
|
||||
if fieldRow.RowKey != "" {
|
||||
ci = append(ci, &pb.ColumnInfo{Name: fieldRow.Field, Datatype: "string"})
|
||||
ci = append(ci, &proto.ColumnInfo{Name: fieldRow.Field, Datatype: "string"})
|
||||
} else if fieldRow.Value != nil {
|
||||
ci = append(ci, &pb.ColumnInfo{Name: fieldRow.Field, Datatype: "int64"})
|
||||
ci = append(ci, &proto.ColumnInfo{Name: fieldRow.Field, Datatype: "int64"})
|
||||
} else {
|
||||
ci = append(ci, &pb.ColumnInfo{Name: fieldRow.Field, Datatype: "uint64"})
|
||||
ci = append(ci, &proto.ColumnInfo{Name: fieldRow.Field, Datatype: "uint64"})
|
||||
}
|
||||
}
|
||||
ci = append(ci, &pb.ColumnInfo{Name: "count", Datatype: "uint64"})
|
||||
ci = append(ci, &proto.ColumnInfo{Name: "count", Datatype: "uint64"})
|
||||
if agg != "" {
|
||||
ci = append(ci, &pb.ColumnInfo{Name: agg, Datatype: "int64"})
|
||||
ci = append(ci, &proto.ColumnInfo{Name: agg, Datatype: "int64"})
|
||||
}
|
||||
|
||||
}
|
||||
rowResp := &pb.RowResponse{
|
||||
rowResp := &proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{},
|
||||
Columns: []*proto.ColumnResponse{},
|
||||
}
|
||||
|
||||
for _, fieldRow := range gc.Group {
|
||||
if fieldRow.RowKey != "" {
|
||||
rowResp.Columns = append(rowResp.Columns, &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_StringVal{StringVal: fieldRow.RowKey}})
|
||||
rowResp.Columns = append(rowResp.Columns, &proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_StringVal{StringVal: fieldRow.RowKey}})
|
||||
} else if fieldRow.Value != nil {
|
||||
rowResp.Columns = append(rowResp.Columns, &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: *fieldRow.Value}})
|
||||
rowResp.Columns = append(rowResp.Columns, &proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: *fieldRow.Value}})
|
||||
} else {
|
||||
rowResp.Columns = append(rowResp.Columns, &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: fieldRow.RowID}})
|
||||
rowResp.Columns = append(rowResp.Columns, &proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Uint64Val{Uint64Val: fieldRow.RowID}})
|
||||
}
|
||||
}
|
||||
rowResp.Columns = append(rowResp.Columns,
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: gc.Count}})
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Uint64Val{Uint64Val: gc.Count}})
|
||||
if agg != "" {
|
||||
rowResp.Columns = append(rowResp.Columns,
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: gc.Agg}})
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: gc.Agg}})
|
||||
}
|
||||
if err := callback(rowResp); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
|
|
@ -3861,93 +3861,93 @@ type ExtractedTable struct {
|
|||
}
|
||||
|
||||
// ToRows implements the ToRowser interface.
|
||||
func (t ExtractedTable) ToRows(callback func(*pb.RowResponse) error) error {
|
||||
func (t ExtractedTable) ToRows(callback func(*proto.RowResponse) error) error {
|
||||
if len(t.Columns) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
headers := make([]*pb.ColumnInfo, len(t.Fields)+1)
|
||||
headers := make([]*proto.ColumnInfo, len(t.Fields)+1)
|
||||
colType := "uint64"
|
||||
if t.Columns[0].Column.Keyed {
|
||||
colType = "string"
|
||||
}
|
||||
headers[0] = &pb.ColumnInfo{
|
||||
headers[0] = &proto.ColumnInfo{
|
||||
Name: "_id",
|
||||
Datatype: colType,
|
||||
}
|
||||
dataHeaders := headers[1:]
|
||||
for i, f := range t.Fields {
|
||||
dataHeaders[i] = &pb.ColumnInfo{
|
||||
dataHeaders[i] = &proto.ColumnInfo{
|
||||
Name: f.Name,
|
||||
Datatype: f.Type,
|
||||
}
|
||||
}
|
||||
|
||||
for _, c := range t.Columns {
|
||||
cols := make([]*pb.ColumnResponse, len(c.Rows)+1)
|
||||
cols := make([]*proto.ColumnResponse, len(c.Rows)+1)
|
||||
if c.Column.Keyed {
|
||||
cols[0] = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_StringVal{
|
||||
cols[0] = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_StringVal{
|
||||
StringVal: c.Column.Key,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
cols[0] = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_Uint64Val{
|
||||
cols[0] = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_Uint64Val{
|
||||
Uint64Val: c.Column.ID,
|
||||
},
|
||||
}
|
||||
}
|
||||
valCols := cols[1:]
|
||||
for i, r := range c.Rows {
|
||||
var col *pb.ColumnResponse
|
||||
var col *proto.ColumnResponse
|
||||
switch r := r.(type) {
|
||||
case nil:
|
||||
col = &pb.ColumnResponse{}
|
||||
col = &proto.ColumnResponse{}
|
||||
case bool:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_BoolVal{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_BoolVal{
|
||||
BoolVal: r,
|
||||
},
|
||||
}
|
||||
case int64:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_Int64Val{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_Int64Val{
|
||||
Int64Val: r,
|
||||
},
|
||||
}
|
||||
case uint64:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_Uint64Val{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_Uint64Val{
|
||||
Uint64Val: r,
|
||||
},
|
||||
}
|
||||
case string:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_StringVal{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_StringVal{
|
||||
StringVal: r,
|
||||
},
|
||||
}
|
||||
case []uint64:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_Uint64ArrayVal{
|
||||
Uint64ArrayVal: &pb.Uint64Array{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_Uint64ArrayVal{
|
||||
Uint64ArrayVal: &proto.Uint64Array{
|
||||
Vals: r,
|
||||
},
|
||||
},
|
||||
}
|
||||
case []string:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_StringArrayVal{
|
||||
StringArrayVal: &pb.StringArray{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_StringArrayVal{
|
||||
StringArrayVal: &proto.StringArray{
|
||||
Vals: r,
|
||||
},
|
||||
},
|
||||
}
|
||||
case pql.Decimal:
|
||||
col = &pb.ColumnResponse{
|
||||
ColumnVal: &pb.ColumnResponse_DecimalVal{
|
||||
DecimalVal: &pb.Decimal{
|
||||
col = &proto.ColumnResponse{
|
||||
ColumnVal: &proto.ColumnResponse_DecimalVal{
|
||||
DecimalVal: &proto.Decimal{
|
||||
Value: r.Value,
|
||||
Scale: r.Scale,
|
||||
},
|
||||
|
|
@ -3958,7 +3958,7 @@ func (t ExtractedTable) ToRows(callback func(*pb.RowResponse) error) error {
|
|||
}
|
||||
valCols[i] = col
|
||||
}
|
||||
err := callback(&pb.RowResponse{
|
||||
err := callback(&proto.RowResponse{
|
||||
Headers: headers,
|
||||
Columns: cols,
|
||||
})
|
||||
|
|
@ -3971,8 +3971,8 @@ func (t ExtractedTable) ToRows(callback func(*pb.RowResponse) error) error {
|
|||
}
|
||||
|
||||
// ToTable converts the table to protobuf format.
|
||||
func (t ExtractedTable) ToTable() (*pb.TableResponse, error) {
|
||||
return pb.RowsToTable(t, len(t.Columns))
|
||||
func (t ExtractedTable) ToTable() (*proto.TableResponse, error) {
|
||||
return proto.RowsToTable(t, len(t.Columns))
|
||||
}
|
||||
|
||||
type ExtractedIDColumn struct {
|
||||
|
|
@ -5633,12 +5633,12 @@ func (e *executor) remoteExec(ctx context.Context, node *topology.Node, index st
|
|||
EmbeddedData: embed,
|
||||
}
|
||||
|
||||
pb, err := e.client.QueryNode(ctx, &node.URI, index, pbreq)
|
||||
resp, err := e.client.QueryNode(ctx, &node.URI, index, pbreq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pb.Results, pb.Err
|
||||
return resp.Results, resp.Err
|
||||
}
|
||||
|
||||
// shardsByNode returns a mapping of nodes to shards.
|
||||
|
|
@ -7305,7 +7305,7 @@ func (s *SignedRow) Field() string {
|
|||
}
|
||||
|
||||
// ToTable implements the ToTabler interface.
|
||||
func (s SignedRow) ToTable() (*pb.TableResponse, error) {
|
||||
func (s SignedRow) ToTable() (*proto.TableResponse, error) {
|
||||
var n uint64
|
||||
if s.Neg != nil {
|
||||
n += s.Neg.Count()
|
||||
|
|
@ -7313,13 +7313,13 @@ func (s SignedRow) ToTable() (*pb.TableResponse, error) {
|
|||
if s.Pos != nil {
|
||||
n += s.Pos.Count()
|
||||
}
|
||||
return pb.RowsToTable(&s, int(n))
|
||||
return proto.RowsToTable(&s, int(n))
|
||||
}
|
||||
|
||||
// ToRows implements the ToRowser interface.
|
||||
func (s SignedRow) ToRows(callback func(*pb.RowResponse) error) error {
|
||||
func (s SignedRow) ToRows(callback func(*proto.RowResponse) error) error {
|
||||
|
||||
ci := []*pb.ColumnInfo{{Name: s.Field(), Datatype: "int64"}}
|
||||
ci := []*proto.ColumnInfo{{Name: s.Field(), Datatype: "int64"}}
|
||||
if s.Neg != nil {
|
||||
negs := s.Neg.Columns()
|
||||
for i := len(negs) - 1; i >= 0; i-- {
|
||||
|
|
@ -7328,10 +7328,10 @@ func (s SignedRow) ToRows(callback func(*pb.RowResponse) error) error {
|
|||
return errors.Wrap(err, "converting uint64 to int64 (negative)")
|
||||
}
|
||||
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: val}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: val}},
|
||||
},
|
||||
}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
|
|
@ -7346,10 +7346,10 @@ func (s SignedRow) ToRows(callback func(*pb.RowResponse) error) error {
|
|||
return errors.Wrap(err, "converting uint64 to int64 (positive)")
|
||||
}
|
||||
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: val}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: val}},
|
||||
},
|
||||
}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
|
|
@ -7430,51 +7430,51 @@ func (v *ValCount) Clone() (r *ValCount) {
|
|||
}
|
||||
|
||||
// ToTable implements the ToTabler interface.
|
||||
func (v ValCount) ToTable() (*pb.TableResponse, error) {
|
||||
return pb.RowsToTable(&v, 1)
|
||||
func (v ValCount) ToTable() (*proto.TableResponse, error) {
|
||||
return proto.RowsToTable(&v, 1)
|
||||
}
|
||||
|
||||
// ToRows implements the ToRowser interface.
|
||||
func (v ValCount) ToRows(callback func(*pb.RowResponse) error) error {
|
||||
var ci []*pb.ColumnInfo
|
||||
func (v ValCount) ToRows(callback func(*proto.RowResponse) error) error {
|
||||
var ci []*proto.ColumnInfo
|
||||
// ValCount can have a decimal, float, or integer value, but
|
||||
// not more than one (as of this writing).
|
||||
if v.DecimalVal != nil {
|
||||
ci = []*pb.ColumnInfo{
|
||||
ci = []*proto.ColumnInfo{
|
||||
{Name: "value", Datatype: "decimal"},
|
||||
{Name: "count", Datatype: "int64"},
|
||||
}
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_DecimalVal{DecimalVal: &pb.Decimal{Value: v.DecimalVal.Value, Scale: v.DecimalVal.Scale}}},
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_DecimalVal{DecimalVal: &proto.Decimal{Value: v.DecimalVal.Value, Scale: v.DecimalVal.Scale}}},
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
}}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
}
|
||||
} else if v.FloatVal != 0 {
|
||||
ci = []*pb.ColumnInfo{
|
||||
ci = []*proto.ColumnInfo{
|
||||
{Name: "value", Datatype: "float64"},
|
||||
{Name: "count", Datatype: "int64"},
|
||||
}
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Float64Val{Float64Val: v.FloatVal}},
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Float64Val{Float64Val: v.FloatVal}},
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
}}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
}
|
||||
} else {
|
||||
ci = []*pb.ColumnInfo{
|
||||
ci = []*proto.ColumnInfo{
|
||||
{Name: "value", Datatype: "int64"},
|
||||
{Name: "count", Datatype: "int64"},
|
||||
}
|
||||
if err := callback(&pb.RowResponse{
|
||||
if err := callback(&proto.RowResponse{
|
||||
Headers: ci,
|
||||
Columns: []*pb.ColumnResponse{
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: v.Val}},
|
||||
&pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
Columns: []*proto.ColumnResponse{
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: v.Val}},
|
||||
&proto.ColumnResponse{ColumnVal: &proto.ColumnResponse_Int64Val{Int64Val: v.Count}},
|
||||
}}); err != nil {
|
||||
return errors.Wrap(err, "calling callback")
|
||||
}
|
||||
|
|
|
|||
11
fragment.go
11
fragment.go
|
|
@ -40,9 +40,9 @@ import (
|
|||
|
||||
"github.com/cespare/xxhash"
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/pilosa/pilosa/v2/internal"
|
||||
"github.com/pilosa/pilosa/v2/logger"
|
||||
pnet "github.com/pilosa/pilosa/v2/net"
|
||||
"github.com/pilosa/pilosa/v2/pb"
|
||||
"github.com/pilosa/pilosa/v2/pql"
|
||||
"github.com/pilosa/pilosa/v2/roaring"
|
||||
"github.com/pilosa/pilosa/v2/shardwidth"
|
||||
|
|
@ -533,7 +533,7 @@ func (f *fragment) openCache() error {
|
|||
}
|
||||
|
||||
// Unmarshal cache data.
|
||||
var pb internal.Cache
|
||||
var pb pb.Cache
|
||||
if err := proto.Unmarshal(buf, &pb); err != nil {
|
||||
f.holder.Logger.Printf("error unmarshaling cache data, skipping: path=%s, err=%s", path, err)
|
||||
return nil
|
||||
|
|
@ -696,7 +696,7 @@ func (f *fragment) setBit(tx Tx, rowID, columnID uint64) (changed bool, err erro
|
|||
err = f.gen.Transaction(wp, doSetFunc)
|
||||
} else {
|
||||
if tx.Type() == RoaringTxn {
|
||||
panic("internal error: f.gen was nil. should never happen under roaring b/c storage should be open")
|
||||
return changed, errors.New("internal error: f.gen was nil and tx.Type is RoaringTxn - should never happen under roaring b/c storage should be open")
|
||||
}
|
||||
// else blue green or transactional backend. Just do it.
|
||||
err = doSetFunc()
|
||||
|
|
@ -2535,9 +2535,8 @@ func (f *fragment) importPositions(tx Tx, set, clear []uint64, rowSet map[uint64
|
|||
err = f.gen.Transaction(wp, doFunc)
|
||||
} else {
|
||||
if tx.Type() == RoaringTxn {
|
||||
panic("internal error: 2nd place, f.gen was nil. should never happen under roaring b/c storage should be open")
|
||||
return errors.New("internal error: f.gen was nil and tx.Type is RoaringTxn - should never happen under roaring b/c storage should be open")
|
||||
}
|
||||
// else blue green or transactional backend. Just do it.
|
||||
err = doFunc()
|
||||
}
|
||||
|
||||
|
|
@ -2992,7 +2991,7 @@ func (f *fragment) flushCache() error {
|
|||
ids := f.cache.IDs()
|
||||
|
||||
// Marshal cache data to bytes.
|
||||
buf, err := proto.Marshal(&internal.Cache{IDs: ids})
|
||||
buf, err := proto.Marshal(&pb.Cache{IDs: ids})
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "marshalling")
|
||||
}
|
||||
|
|
|
|||
31
go.mod
31
go.mod
|
|
@ -4,31 +4,29 @@ replace go.etcd.io/etcd => github.com/molecula/etcd v0.0.0-20210115113447-5d28bd
|
|||
|
||||
require (
|
||||
github.com/CAFxX/gcnotifier v0.0.0-20190112062741-224a280d589d
|
||||
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895
|
||||
github.com/DataDog/datadog-go v2.2.0+incompatible
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.0 // indirect
|
||||
github.com/beevik/ntp v0.3.0
|
||||
github.com/benbjohnson/immutable v0.3.0
|
||||
github.com/cespare/xxhash v1.1.0
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.4.9 // indirect
|
||||
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 // indirect
|
||||
github.com/glycerine/idem v0.0.0-20190127113923-7a8083893311
|
||||
github.com/gogo/protobuf v1.2.1
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/protobuf v1.3.3
|
||||
github.com/google/go-cmp v0.5.2
|
||||
github.com/google/go-cmp v0.5.5
|
||||
github.com/google/uuid v1.1.4 // indirect
|
||||
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect
|
||||
github.com/gorilla/handlers v1.3.0
|
||||
github.com/gorilla/mux v1.7.0
|
||||
github.com/improbable-eng/grpc-web v0.13.0
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/lib/pq v1.8.0
|
||||
github.com/molecula/apophenia v0.0.0-20190827192002-68b7a14a478b
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
|
||||
github.com/opentracing/opentracing-go v1.1.0
|
||||
github.com/pelletier/go-toml v1.2.0
|
||||
github.com/pelletier/go-toml v1.4.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/prometheus/client_golang v1.0.0
|
||||
github.com/prometheus/client_model v0.1.0
|
||||
|
|
@ -38,24 +36,21 @@ require (
|
|||
github.com/rs/cors v1.7.0 // indirect
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/shirou/gopsutil/v3 v3.20.11
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/spf13/cobra v1.1.1
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/spf13/viper v1.7.1
|
||||
github.com/uber-go/atomic v1.4.0 // indirect
|
||||
github.com/uber/jaeger-client-go v2.16.0+incompatible
|
||||
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
|
||||
github.com/zeebo/blake3 v0.0.4
|
||||
github.com/uber/jaeger-client-go v2.25.0+incompatible
|
||||
github.com/uber/jaeger-lib v2.4.0+incompatible // indirect
|
||||
github.com/zeebo/blake3 v0.1.1
|
||||
go.etcd.io/bbolt v1.3.5
|
||||
go.etcd.io/etcd v0.0.0-20201125193152-8a03d2e9614b
|
||||
golang.org/x/exp v0.0.0-20201008143054-e3b2a7f2fdc7
|
||||
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
|
||||
golang.org/x/sys v0.0.0-20201214095126-aec9a390925b // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
golang.org/x/mod v0.4.2
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 // indirect
|
||||
golang.org/x/text v0.3.5 // indirect
|
||||
google.golang.org/grpc v1.28.0
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
modernc.org/mathutil v1.0.0
|
||||
modernc.org/strutil v1.0.0
|
||||
|
|
|
|||
123
go.sum
123
go.sum
|
|
@ -16,19 +16,21 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
|
|||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/CAFxX/gcnotifier v0.0.0-20190112062741-224a280d589d h1:n0G4ckjMEj7bWuGYUX0i8YlBeBBJuZ+HEHvHfyBDZtI=
|
||||
github.com/CAFxX/gcnotifier v0.0.0-20190112062741-224a280d589d/go.mod h1:Rn2zM2MnHze07LwkneP48TWt6UiZhzQTwCvw6djVGfE=
|
||||
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895 h1:dmc/C8bpE5VkQn65PNbbyACDC8xw8Hpp/NEurdPmQDQ=
|
||||
github.com/DataDog/datadog-go v0.0.0-20180822151419-281ae9f2d895/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/DataDog/datadog-go v2.2.0+incompatible h1:V5BKkxACZLjzHjSgBbr2gvLA2Ae49yhc6CSY7MLy5k4=
|
||||
github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.0 h1:6dpdDPTRoo78HxAJ6T1HfMiKSnqhgRRqzCuPshRkQ7I=
|
||||
github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/beevik/ntp v0.3.0 h1:xzVrPrE4ziasFXgBVBZJDP0Wg/KpMwk2KHJ4Ba8GrDw=
|
||||
|
|
@ -47,11 +49,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
|||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.13+incompatible h1:8F3hqu9fGYLBifCmRCJsicFqDx/D68Rt3q1JMazcgBQ=
|
||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
|
||||
|
|
@ -81,7 +79,7 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
|
|||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
|
|
@ -100,8 +98,10 @@ github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
|||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
|
|
@ -120,8 +120,9 @@ github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
|||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
|
|
@ -142,39 +143,28 @@ github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
|
|||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0 h1:bM6ZAFZmc/wPFaRDi0d5L7hGEZEx/2u+Tmr2evNHDiI=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
|
|
@ -188,7 +178,6 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
|
|||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
|
|
@ -196,17 +185,16 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
|
|||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
|
|
@ -220,11 +208,9 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
|
|||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
|
|
@ -250,10 +236,10 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
|
|||
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg=
|
||||
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
|
|
@ -294,7 +280,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
|
|||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
|
||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/shirou/gopsutil/v3 v3.20.11 h1:NeVf1K0cgxsWz+N3671ojRptdgzvp7BXL3KV21R0JnA=
|
||||
github.com/shirou/gopsutil/v3 v3.20.11/go.mod h1:igHnfak0qnw1biGeI2qKQvu0ZkwvEkUcCLlYhZzdr/4=
|
||||
|
|
@ -308,9 +293,8 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
|
|||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
|
||||
|
|
@ -332,31 +316,30 @@ github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
|||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/uber-go/atomic v1.4.0 h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o=
|
||||
github.com/uber-go/atomic v1.4.0/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
|
||||
github.com/uber/jaeger-client-go v2.16.0+incompatible h1:Q2Pp6v3QYiocMxomCaJuwQGFt7E53bPYqEgug/AoBtY=
|
||||
github.com/uber/jaeger-client-go v2.16.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
|
||||
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
|
||||
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
|
||||
github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U=
|
||||
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
|
||||
github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaWxXbjwyYwsNaLQ=
|
||||
github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/zeebo/assert v0.0.0-20181109011804-10f827ce2ed6/go.mod h1:yssERNPivllc1yU3BvpjYI5BUW+zglcz6QWqeVRL5t0=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=
|
||||
github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
||||
github.com/zeebo/blake3 v0.0.4 h1:vtZ4X8B2lKXZFg2Xyg6Wo36mvmnJvc2VQYTtA4RDCkI=
|
||||
github.com/zeebo/blake3 v0.0.4/go.mod h1:YOZo8A49yNqM0X/Y+JmDUZshJWLt1laHsNSn5ny2i34=
|
||||
github.com/zeebo/pcg v0.0.0-20181207190024-3cdc6b625a05 h1:4pW5fMvVkrgkMXdvIsVRRTs69DWYA8uNNQsu1stfVKU=
|
||||
github.com/zeebo/pcg v0.0.0-20181207190024-3cdc6b625a05/go.mod h1:Gr+78ptB0MwXxm//LBaEvBiaXY7hXJ6KGe2V32X2F6E=
|
||||
github.com/zeebo/blake3 v0.1.1 h1:Nbsts7DdKThRHHd+YNlqiGlRqGEF2bE2eXN+xQ1hsEs=
|
||||
github.com/zeebo/blake3 v0.1.1/go.mod h1:G9pM4qQwjRzF1/v7+vabMj/c5mWpGZ2Wzo3Eb4z0pb4=
|
||||
github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0=
|
||||
github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
|
|
@ -377,13 +360,17 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
|
|||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20201008143054-e3b2a7f2fdc7 h1:2/QncOxxpPAdiH+E00abYw/SaQG353gltz79Nl1zrYE=
|
||||
golang.org/x/exp v0.0.0-20201008143054-e3b2a7f2fdc7/go.mod h1:1phAWC201xIgDyaFpmDeZkgf70Q4Pd/CNqfRtVPtxNw=
|
||||
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
|
|
@ -398,8 +385,11 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc
|
|||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
|
|
@ -416,8 +406,10 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
|
|||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 h1:b0LrWgu8+q7z4J+0Y3Umo5q1dL7NXBkKBWkaVkAq17E=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
|
|
@ -426,8 +418,10 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
|
|||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
|
|
@ -446,23 +440,29 @@ golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201024232916-9f70ab9862d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201214095126-aec9a390925b h1:tv7/y4pd+sR8bcNb2D6o7BNU6zjWm0VjQLac+w7fNNM=
|
||||
golang.org/x/sys v0.0.0-20201214095126-aec9a390925b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4 h1:EZ2mChiOa8udjfp6rRmswTbtZN/QzUQp4ptM4rnjHvc=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
|
|
@ -480,11 +480,19 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn
|
|||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
|
||||
gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM=
|
||||
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
|
||||
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0 h1:OE9mWmgKkjJyEmDAAtGMPjXu+YNeGvK9VTSHY6+Qihc=
|
||||
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
||||
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
|
|
@ -500,7 +508,6 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn
|
|||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4=
|
||||
|
|
@ -525,7 +532,6 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
|||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
|
@ -543,6 +549,7 @@ modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03
|
|||
modernc.org/strutil v1.0.0 h1:XVFtQwFVwc02Wk+0L/Z/zDDXO81r5Lhe6iMKmGX3KhE=
|
||||
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ type TranslateKeysRequest struct {
|
|||
Field string
|
||||
Keys []string
|
||||
|
||||
// it's a awkward name, just to keep backward compatibility with go-pilosa and idk.
|
||||
// NotWritable is an awkward name, but it's just to keep backward compatibility with client and idk.
|
||||
NotWritable bool
|
||||
}
|
||||
|
||||
|
|
|
|||
202
internal/LICENSE
202
internal/LICENSE
|
|
@ -1,202 +0,0 @@
|
|||
|
||||
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.
|
||||
44
net/uri.go
44
net/uri.go
|
|
@ -26,9 +26,14 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var schemeRegexp = regexp.MustCompile("^[+a-z]+$")
|
||||
var hostRegexp = regexp.MustCompile(`^[0-9a-z.-]+$|^\[[:0-9a-fA-F]+\]$`)
|
||||
var addressRegexp = regexp.MustCompile(`^(([+a-z]+):\/\/)?([0-9a-z.-]+|\[[:0-9a-fA-F]+\])?(:([0-9]+))?$`)
|
||||
var (
|
||||
schemeRegexp = regexp.MustCompile("^[+a-z]+$")
|
||||
hostRegexp = regexp.MustCompile(`^[0-9a-z.-]+$|^\[[:0-9a-fA-F]+\]$`)
|
||||
addressRegexp = regexp.MustCompile(`^(([+a-z]+):\/\/)?([0-9a-z.-]+|\[[:0-9a-fA-F]+\])?(:([0-9]+))?$`)
|
||||
|
||||
ErrInvalidAddress = errors.New("invalid address")
|
||||
ErrInvalidSchema = errors.New("invalid schema")
|
||||
)
|
||||
|
||||
// URI represents a Pilosa URI.
|
||||
// A Pilosa URI consists of three parts:
|
||||
|
|
@ -56,11 +61,6 @@ func (u *URI) URL() url.URL {
|
|||
|
||||
// DefaultURI creates and returns the default URI.
|
||||
func DefaultURI() *URI {
|
||||
return defaultURI()
|
||||
}
|
||||
|
||||
// defaultURI creates and returns the default URI.
|
||||
func defaultURI() *URI {
|
||||
return &URI{
|
||||
Scheme: "http",
|
||||
Host: "localhost",
|
||||
|
|
@ -83,7 +83,7 @@ func (u URIs) HostPortStrings() []string {
|
|||
|
||||
// NewURIFromHostPort returns a URI with specified host and port.
|
||||
func NewURIFromHostPort(host string, port uint16) (*URI, error) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
err := uri.SetHost(host)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "setting uri host")
|
||||
|
|
@ -101,7 +101,7 @@ func NewURIFromAddress(address string) (*URI, error) {
|
|||
func (u *URI) SetScheme(scheme string) error {
|
||||
m := schemeRegexp.FindStringSubmatch(scheme)
|
||||
if m == nil {
|
||||
return errors.New("invalid scheme")
|
||||
return ErrInvalidSchema
|
||||
}
|
||||
u.Scheme = scheme
|
||||
return nil
|
||||
|
|
@ -133,7 +133,7 @@ func (u *URI) HostPort() string {
|
|||
}
|
||||
|
||||
// normalize returns the address in a form usable by a HTTP client.
|
||||
func (u *URI) normalize() string {
|
||||
func (u *URI) Normalize() string {
|
||||
scheme := u.Scheme
|
||||
index := strings.Index(scheme, "+")
|
||||
if index >= 0 {
|
||||
|
|
@ -142,6 +142,16 @@ func (u *URI) normalize() string {
|
|||
return fmt.Sprintf("%s://%s:%d", scheme, u.Host, u.Port)
|
||||
}
|
||||
|
||||
// Equals returns true if the checked URI is equivalent to this URI.
|
||||
func (u URI) Equals(other *URI) bool {
|
||||
if other == nil {
|
||||
return false
|
||||
}
|
||||
return u.Scheme == other.Scheme &&
|
||||
u.Host == other.Host &&
|
||||
u.Port == other.Port
|
||||
}
|
||||
|
||||
// String returns the address as a string.
|
||||
func (u URI) String() string {
|
||||
return fmt.Sprintf("%s://%s:%d", u.Scheme, u.Host, u.Port)
|
||||
|
|
@ -149,7 +159,7 @@ func (u URI) String() string {
|
|||
|
||||
// Path returns URI with path
|
||||
func (u *URI) Path(path string) string {
|
||||
return fmt.Sprintf("%s%s", u.normalize(), path)
|
||||
return fmt.Sprintf("%s%s", u.Normalize(), path)
|
||||
}
|
||||
|
||||
// The following methods are required to implement pflag Value interface.
|
||||
|
|
@ -169,10 +179,18 @@ func (u URI) Type() string {
|
|||
return "URI"
|
||||
}
|
||||
|
||||
// Translate returns the translated URI based on the provided NAT map.
|
||||
func (u URI) Translate(nat map[URI]URI) URI {
|
||||
if translated, ok := nat[u]; ok {
|
||||
return translated
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
func parseAddress(address string) (uri *URI, err error) {
|
||||
m := addressRegexp.FindStringSubmatch(address)
|
||||
if m == nil {
|
||||
return nil, errors.New("invalid address")
|
||||
return nil, ErrInvalidAddress
|
||||
}
|
||||
scheme := "http"
|
||||
if m[2] != "" {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ package net
|
|||
import "testing"
|
||||
|
||||
func TestDefaultURI(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
compare(t, uri, "http", "localhost", 10101)
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ func TestNormalizedAddress(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("Can't parse address")
|
||||
}
|
||||
if uri.normalize() != "http://big-data.pilosa.com:6888" {
|
||||
if uri.Normalize() != "http://big-data.pilosa.com:6888" {
|
||||
t.Fatalf("Normalized address is not normal")
|
||||
}
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ func TestURIPath(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSetScheme(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
target := "fun"
|
||||
err := uri.SetScheme(target)
|
||||
if err != nil {
|
||||
|
|
@ -89,7 +89,7 @@ func TestSetScheme(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSetHost(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
target := "10.20.30.40"
|
||||
err := uri.SetHost(target)
|
||||
if err != nil {
|
||||
|
|
@ -101,7 +101,7 @@ func TestSetHost(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSetPort(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
target := uint16(9999)
|
||||
uri.SetPort(target)
|
||||
if uri.Port != target {
|
||||
|
|
@ -110,7 +110,7 @@ func TestSetPort(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSetInvalidScheme(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
err := uri.SetScheme("?invalid")
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
|
|
@ -118,7 +118,7 @@ func TestSetInvalidScheme(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestSetInvalidHost(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
uri := DefaultURI()
|
||||
err := uri.SetHost("index?.pilosa.com")
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package internal
|
||||
package pb
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
|
@ -1,7 +1,24 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: private.proto
|
||||
|
||||
package internal
|
||||
package pb
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
|
|
@ -2472,143 +2489,142 @@ func (m *ResizeNodeMessage) GetAction() string {
|
|||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*IndexMeta)(nil), "internal.IndexMeta")
|
||||
proto.RegisterType((*FieldOptions)(nil), "internal.FieldOptions")
|
||||
proto.RegisterType((*ImportResponse)(nil), "internal.ImportResponse")
|
||||
proto.RegisterType((*BlockDataRequest)(nil), "internal.BlockDataRequest")
|
||||
proto.RegisterType((*BlockDataResponse)(nil), "internal.BlockDataResponse")
|
||||
proto.RegisterType((*Cache)(nil), "internal.Cache")
|
||||
proto.RegisterType((*MaxShards)(nil), "internal.MaxShards")
|
||||
proto.RegisterMapType((map[string]uint64)(nil), "internal.MaxShards.StandardEntry")
|
||||
proto.RegisterType((*CreateShardMessage)(nil), "internal.CreateShardMessage")
|
||||
proto.RegisterType((*DeleteIndexMessage)(nil), "internal.DeleteIndexMessage")
|
||||
proto.RegisterType((*CreateIndexMessage)(nil), "internal.CreateIndexMessage")
|
||||
proto.RegisterType((*CreateFieldMessage)(nil), "internal.CreateFieldMessage")
|
||||
proto.RegisterType((*DeleteFieldMessage)(nil), "internal.DeleteFieldMessage")
|
||||
proto.RegisterType((*DeleteAvailableShardMessage)(nil), "internal.DeleteAvailableShardMessage")
|
||||
proto.RegisterType((*Field)(nil), "internal.Field")
|
||||
proto.RegisterType((*Schema)(nil), "internal.Schema")
|
||||
proto.RegisterType((*Index)(nil), "internal.Index")
|
||||
proto.RegisterType((*URI)(nil), "internal.URI")
|
||||
proto.RegisterType((*Node)(nil), "internal.Node")
|
||||
proto.RegisterType((*NodeStateMessage)(nil), "internal.NodeStateMessage")
|
||||
proto.RegisterType((*NodeEventMessage)(nil), "internal.NodeEventMessage")
|
||||
proto.RegisterType((*NodeStatus)(nil), "internal.NodeStatus")
|
||||
proto.RegisterType((*IndexStatus)(nil), "internal.IndexStatus")
|
||||
proto.RegisterType((*FieldStatus)(nil), "internal.FieldStatus")
|
||||
proto.RegisterType((*ClusterStatus)(nil), "internal.ClusterStatus")
|
||||
proto.RegisterType((*BSIGroup)(nil), "internal.BSIGroup")
|
||||
proto.RegisterType((*CreateViewMessage)(nil), "internal.CreateViewMessage")
|
||||
proto.RegisterType((*DeleteViewMessage)(nil), "internal.DeleteViewMessage")
|
||||
proto.RegisterType((*ResizeInstruction)(nil), "internal.ResizeInstruction")
|
||||
proto.RegisterType((*ResizeSource)(nil), "internal.ResizeSource")
|
||||
proto.RegisterType((*TranslationResizeSource)(nil), "internal.TranslationResizeSource")
|
||||
proto.RegisterType((*ResizeInstructionComplete)(nil), "internal.ResizeInstructionComplete")
|
||||
proto.RegisterType((*Topology)(nil), "internal.Topology")
|
||||
proto.RegisterType((*RecalculateCaches)(nil), "internal.RecalculateCaches")
|
||||
proto.RegisterType((*LoadSchemaMessage)(nil), "internal.LoadSchemaMessage")
|
||||
proto.RegisterType((*TransactionMessage)(nil), "internal.TransactionMessage")
|
||||
proto.RegisterType((*Transaction)(nil), "internal.Transaction")
|
||||
proto.RegisterType((*TransactionStats)(nil), "internal.TransactionStats")
|
||||
proto.RegisterType((*ResizeAbortMessage)(nil), "internal.ResizeAbortMessage")
|
||||
proto.RegisterType((*ResizeNodeMessage)(nil), "internal.ResizeNodeMessage")
|
||||
proto.RegisterType((*IndexMeta)(nil), "pb.IndexMeta")
|
||||
proto.RegisterType((*FieldOptions)(nil), "pb.FieldOptions")
|
||||
proto.RegisterType((*ImportResponse)(nil), "pb.ImportResponse")
|
||||
proto.RegisterType((*BlockDataRequest)(nil), "pb.BlockDataRequest")
|
||||
proto.RegisterType((*BlockDataResponse)(nil), "pb.BlockDataResponse")
|
||||
proto.RegisterType((*Cache)(nil), "pb.Cache")
|
||||
proto.RegisterType((*MaxShards)(nil), "pb.MaxShards")
|
||||
proto.RegisterMapType((map[string]uint64)(nil), "pb.MaxShards.StandardEntry")
|
||||
proto.RegisterType((*CreateShardMessage)(nil), "pb.CreateShardMessage")
|
||||
proto.RegisterType((*DeleteIndexMessage)(nil), "pb.DeleteIndexMessage")
|
||||
proto.RegisterType((*CreateIndexMessage)(nil), "pb.CreateIndexMessage")
|
||||
proto.RegisterType((*CreateFieldMessage)(nil), "pb.CreateFieldMessage")
|
||||
proto.RegisterType((*DeleteFieldMessage)(nil), "pb.DeleteFieldMessage")
|
||||
proto.RegisterType((*DeleteAvailableShardMessage)(nil), "pb.DeleteAvailableShardMessage")
|
||||
proto.RegisterType((*Field)(nil), "pb.Field")
|
||||
proto.RegisterType((*Schema)(nil), "pb.Schema")
|
||||
proto.RegisterType((*Index)(nil), "pb.Index")
|
||||
proto.RegisterType((*URI)(nil), "pb.URI")
|
||||
proto.RegisterType((*Node)(nil), "pb.Node")
|
||||
proto.RegisterType((*NodeStateMessage)(nil), "pb.NodeStateMessage")
|
||||
proto.RegisterType((*NodeEventMessage)(nil), "pb.NodeEventMessage")
|
||||
proto.RegisterType((*NodeStatus)(nil), "pb.NodeStatus")
|
||||
proto.RegisterType((*IndexStatus)(nil), "pb.IndexStatus")
|
||||
proto.RegisterType((*FieldStatus)(nil), "pb.FieldStatus")
|
||||
proto.RegisterType((*ClusterStatus)(nil), "pb.ClusterStatus")
|
||||
proto.RegisterType((*BSIGroup)(nil), "pb.BSIGroup")
|
||||
proto.RegisterType((*CreateViewMessage)(nil), "pb.CreateViewMessage")
|
||||
proto.RegisterType((*DeleteViewMessage)(nil), "pb.DeleteViewMessage")
|
||||
proto.RegisterType((*ResizeInstruction)(nil), "pb.ResizeInstruction")
|
||||
proto.RegisterType((*ResizeSource)(nil), "pb.ResizeSource")
|
||||
proto.RegisterType((*TranslationResizeSource)(nil), "pb.TranslationResizeSource")
|
||||
proto.RegisterType((*ResizeInstructionComplete)(nil), "pb.ResizeInstructionComplete")
|
||||
proto.RegisterType((*Topology)(nil), "pb.Topology")
|
||||
proto.RegisterType((*RecalculateCaches)(nil), "pb.RecalculateCaches")
|
||||
proto.RegisterType((*LoadSchemaMessage)(nil), "pb.LoadSchemaMessage")
|
||||
proto.RegisterType((*TransactionMessage)(nil), "pb.TransactionMessage")
|
||||
proto.RegisterType((*Transaction)(nil), "pb.Transaction")
|
||||
proto.RegisterType((*TransactionStats)(nil), "pb.TransactionStats")
|
||||
proto.RegisterType((*ResizeAbortMessage)(nil), "pb.ResizeAbortMessage")
|
||||
proto.RegisterType((*ResizeNodeMessage)(nil), "pb.ResizeNodeMessage")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("private.proto", fileDescriptor_d2a91b51c7bdc125) }
|
||||
|
||||
var fileDescriptor_d2a91b51c7bdc125 = []byte{
|
||||
// 1456 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xdd, 0x6e, 0x1b, 0xc5,
|
||||
0x17, 0xff, 0xaf, 0xd7, 0x8e, 0xed, 0xe3, 0x38, 0x75, 0xa6, 0x69, 0xba, 0xcd, 0xbf, 0x0a, 0x66,
|
||||
0x40, 0xd4, 0x54, 0x6a, 0xa8, 0x5a, 0x24, 0x10, 0xa8, 0x52, 0x93, 0x38, 0x2d, 0x86, 0xa6, 0x4d,
|
||||
0x27, 0x69, 0xef, 0x27, 0xeb, 0x51, 0xb3, 0xca, 0x7a, 0xd7, 0xdd, 0x8f, 0xd4, 0x2e, 0x12, 0xb7,
|
||||
0x20, 0xb8, 0x42, 0x70, 0xc1, 0x25, 0xef, 0xc1, 0x0b, 0x70, 0xc9, 0x23, 0xa0, 0xf2, 0x04, 0xbc,
|
||||
0x01, 0x9a, 0x33, 0x33, 0xbb, 0x6b, 0xc7, 0xa9, 0x43, 0xcb, 0xdd, 0x9e, 0xef, 0xdf, 0xf9, 0x98,
|
||||
0x33, 0x63, 0x43, 0x73, 0x18, 0x79, 0x27, 0x3c, 0x11, 0x1b, 0xc3, 0x28, 0x4c, 0x42, 0x52, 0xf3,
|
||||
0x82, 0x44, 0x44, 0x01, 0xf7, 0xd7, 0x16, 0x87, 0xe9, 0xa1, 0xef, 0xb9, 0x8a, 0x4f, 0xef, 0x43,
|
||||
0xbd, 0x17, 0xf4, 0xc5, 0x68, 0x57, 0x24, 0x9c, 0x10, 0x28, 0x7f, 0x25, 0xc6, 0xb1, 0x63, 0xb7,
|
||||
0xad, 0x4e, 0x8d, 0xe1, 0x37, 0xf9, 0x00, 0x96, 0x0e, 0x22, 0xee, 0x1e, 0xef, 0x8c, 0xbc, 0x38,
|
||||
0x11, 0x81, 0x2b, 0x9c, 0x32, 0x4a, 0xa7, 0xb8, 0xf4, 0x57, 0x1b, 0x16, 0xef, 0x79, 0xc2, 0xef,
|
||||
0x3f, 0x1a, 0x26, 0x5e, 0x18, 0xc4, 0xd2, 0xd9, 0xc1, 0x78, 0x28, 0x9c, 0x5a, 0xdb, 0xea, 0xd4,
|
||||
0x19, 0x7e, 0x93, 0xab, 0x50, 0xdf, 0xe6, 0xee, 0x91, 0x40, 0x81, 0x8d, 0x82, 0x9c, 0x91, 0x49,
|
||||
0xf7, 0xbd, 0x97, 0x2a, 0x4a, 0x93, 0xe5, 0x0c, 0xd2, 0x86, 0xc6, 0x81, 0x37, 0x10, 0x8f, 0x53,
|
||||
0x1e, 0x24, 0xe9, 0xc0, 0xa9, 0xa0, 0x75, 0x91, 0x45, 0x56, 0x61, 0xe1, 0x91, 0xdf, 0xdf, 0xf5,
|
||||
0x02, 0xa7,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 0x02,
|
||||
0x83, 0x35, 0x6e, 0x5d, 0xcc, 0xeb, 0x94, 0x6d, 0x11, 0x86, 0x0a, 0xd8, 0x1b, 0x74, 0xda, 0xdf,
|
||||
0x4c, 0x10, 0xb0, 0xcd, 0x72, 0x06, 0xfd, 0xde, 0x32, 0x31, 0x31, 0x89, 0x73, 0xe6, 0x3d, 0x31,
|
||||
0x69, 0xd7, 0x35, 0x12, 0x1b, 0x91, 0xac, 0xe6, 0x48, 0x8a, 0x5b, 0x68, 0x16, 0x98, 0xf2, 0x34,
|
||||
0x98, 0xbb, 0xa6, 0x56, 0x6f, 0x8a, 0x85, 0xba, 0xf0, 0x7f, 0xe5, 0x61, 0xf3, 0x84, 0x7b, 0x3e,
|
||||
0x3f, 0xf4, 0xff, 0x55, 0x3b, 0x27, 0xd2, 0x72, 0xa0, 0x8a, 0xb6, 0xbd, 0xae, 0x3e, 0x18, 0x86,
|
||||
0xa4, 0x5f, 0x43, 0x7e, 0xc6, 0x1e, 0xf2, 0x81, 0xd0, 0xde, 0xf0, 0x3b, 0xab, 0x46, 0xe9, 0x1c,
|
||||
0xd5, 0x58, 0x81, 0x8a, 0x3c, 0x97, 0x72, 0xcf, 0xdb, 0x32, 0x30, 0x12, 0x73, 0x6a, 0x74, 0x1b,
|
||||
0x16, 0xf6, 0xdd, 0x23, 0x31, 0xe0, 0xe4, 0x43, 0xa8, 0x22, 0x7e, 0x11, 0xeb, 0xc3, 0x72, 0x61,
|
||||
0x6a, 0x08, 0x98, 0x91, 0xd3, 0x1f, 0x2d, 0x9d, 0xf8, 0x4c, 0xc8, 0x13, 0x01, 0x4b, 0x53, 0x01,
|
||||
0xc9, 0x0d, 0xa8, 0x6a, 0xd4, 0xb8, 0x4b, 0xce, 0x98, 0x35, 0xa3, 0x43, 0xae, 0xc1, 0x02, 0x66,
|
||||
0x1a, 0x3b, 0xe5, 0x69, 0x50, 0xc8, 0x67, 0x5a, 0x4c, 0x77, 0xc0, 0x7e, 0xc2, 0x7a,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xd5, 0xfd, 0x30, 0x8d, 0xdc, 0xec,
|
||||
0x74, 0x14, 0x2e, 0x05, 0x85, 0x48, 0x89, 0x99, 0x51, 0x23, 0x8f, 0x81, 0x1c, 0x44, 0x3c, 0x88,
|
||||
0x7d, 0x2e, 0x41, 0x1a, 0xe3, 0xda, 0xf4, 0x8b, 0xa8, 0xa0, 0x33, 0xe1, 0x67, 0x86, 0x31, 0xf9,
|
||||
0xb8, 0x78, 0xfc, 0x9d, 0x2a, 0x22, 0x5e, 0x99, 0x44, 0xac, 0x4f, 0x54, 0x71, 0x4d, 0xdc, 0x99,
|
||||
0x9a, 0x65, 0x67, 0x01, 0x0d, 0x2f, 0xe7, 0x86, 0x13, 0x62, 0x36, 0xa9, 0x4d, 0xbf, 0xb3, 0x60,
|
||||
0xb1, 0x88, 0xec, 0x5c, 0x6b, 0x27, 0x6b, 0x74, 0x69, 0xfe, 0x93, 0xcb, 0x34, 0xba, 0x3c, 0xeb,
|
||||
0x91, 0x5b, 0x29, 0x3e, 0xc3, 0x52, 0xb8, 0x7c, 0x46, 0xb9, 0xde, 0x02, 0x54, 0x1b, 0x1a, 0x7b,
|
||||
0x3c, 0x4a, 0x3c, 0xe9, 0x52, 0x3f, 0x13, 0x2a, 0xac, 0xc8, 0xa2, 0xc7, 0x70, 0xe5, 0xd4, 0xd0,
|
||||
0x6d, 0x87, 0x83, 0xa1, 0x9c, 0xee, 0xb7, 0x18, 0x3e, 0x79, 0x0f, 0x44, 0x51, 0x18, 0x99, 0x6a,
|
||||
0x20, 0x41, 0xb7, 0xa0, 0x76, 0x10, 0x0e, 0x43, 0x3f, 0x7c, 0x36, 0x9e, 0xb3, 0x74, 0x1c, 0xa8,
|
||||
0xaa, 0xbb, 0x47, 0x2d, 0xb9, 0x3a, 0x33, 0x24, 0xbd, 0x28, 0x4f, 0x89, 0xcb, 0x7d, 0x37, 0xf5,
|
||||
0x79, 0x22, 0xf0, 0xd9, 0x8e, 0xcc, 0x07, 0x21, 0xef, 0xab, 0x5d, 0xa2, 0x0f, 0x24, 0x15, 0x7a,
|
||||
0x48, 0x39, 0x26, 0x55, 0xb8, 0xe3, 0x36, 0x91, 0x61, 0xee, 0x38, 0x45, 0x91, 0x4f, 0xa0, 0x51,
|
||||
0xd0, 0xd6, 0xc9, 0x5d, 0x9a, 0x9a, 0x65, 0x25, 0x64, 0x45, 0x4d, 0xfa, 0x9b, 0x35, 0x61, 0x79,
|
||||
0xea, 0x9a, 0xd7, 0x01, 0x4f, 0x54, 0xc1, 0x6a, 0x4c, 0x53, 0xb2, 0x00, 0x3b, 0x23, 0xd7, 0x4f,
|
||||
0x63, 0x29, 0xd2, 0xb7, 0x7b, 0xc6, 0x90, 0x05, 0x90, 0x3f, 0x58, 0xc3, 0xd4, 0xbc, 0xb0, 0x0c,
|
||||
0x29, 0x7f, 0x3b, 0x76, 0x05, 0xef, 0xfb, 0x5e, 0x20, 0x70, 0x82, 0x6c, 0x96, 0xd1, 0xe4, 0xa6,
|
||||
0xda, 0xd5, 0xe6, 0x18, 0xac, 0xcd, 0x84, 0x8f, 0x1a, 0x6a, 0x8f, 0xc7, 0x94, 0x40, 0x6b, 0x5a,
|
||||
0x44, 0x57, 0x80, 0xa8, 0x99, 0xd8, 0x3c, 0x0c, 0x23, 0x73, 0xb5, 0xd3, 0x6d, 0xb3, 0x9e, 0x64,
|
||||
0x27, 0xe6, 0xbd, 0x18, 0xf2, 0x2a, 0x97, 0x8a, 0x55, 0xde, 0x6a, 0xfd, 0xfe, 0x6a, 0xdd, 0xfa,
|
||||
0xe3, 0xd5, 0xba, 0xf5, 0xe7, 0xab, 0x75, 0xeb, 0x97, 0xbf, 0xd6, 0xff, 0x77, 0xb8, 0x80, 0xff,
|
||||
0x2e, 0xdc, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0x17, 0x40, 0x19, 0xfb, 0x86, 0x10, 0x00, 0x00,
|
||||
// 1436 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdd, 0x6e, 0x1b, 0xc5,
|
||||
0x17, 0xff, 0xef, 0x87, 0x63, 0xfb, 0x38, 0x4e, 0x9c, 0xf9, 0x47, 0x65, 0xfb, 0x41, 0xe4, 0x0e,
|
||||
0x88, 0x86, 0x4a, 0x44, 0xa2, 0x5c, 0x14, 0xc1, 0x4d, 0x93, 0x38, 0x2d, 0xa6, 0xa4, 0x0d, 0xe3,
|
||||
0xb4, 0xb7, 0x68, 0xbc, 0x1e, 0x35, 0xab, 0xac, 0x77, 0xcd, 0x7e, 0xa4, 0x76, 0x2f, 0x90, 0x40,
|
||||
0x20, 0x78, 0x00, 0x2e, 0x78, 0x11, 0xde, 0x81, 0x1b, 0x24, 0x1e, 0x01, 0x95, 0x17, 0x41, 0x73,
|
||||
0x66, 0x66, 0x77, 0xed, 0xba, 0x35, 0x44, 0xdc, 0xed, 0xf9, 0x9d, 0x99, 0x73, 0x7e, 0xe7, 0x63,
|
||||
0xce, 0xcc, 0x42, 0x7b, 0x92, 0x04, 0x17, 0x3c, 0x13, 0x7b, 0x93, 0x24, 0xce, 0x62, 0x62, 0x4f,
|
||||
0x86, 0xd7, 0xd6, 0x27, 0xf9, 0x30, 0x0c, 0x7c, 0x85, 0xd0, 0x07, 0xd0, 0xec, 0x47, 0x23, 0x31,
|
||||
0x3d, 0x16, 0x19, 0x27, 0x04, 0xdc, 0x87, 0x62, 0x96, 0x7a, 0x4e, 0xd7, 0xda, 0x6d, 0x30, 0xfc,
|
||||
0x26, 0xef, 0xc1, 0xc6, 0x69, 0xc2, 0xfd, 0xf3, 0xa3, 0x69, 0x90, 0x66, 0x22, 0xf2, 0x85, 0xe7,
|
||||
0xa2, 0x76, 0x01, 0xa5, 0x3f, 0x3b, 0xb0, 0x7e, 0x3f, 0x10, 0xe1, 0xe8, 0xf1, 0x24, 0x0b, 0xe2,
|
||||
0x28, 0x95, 0xc6, 0x4e, 0x67, 0x13, 0xe1, 0x35, 0xba, 0xd6, 0x6e, 0x93, 0xe1, 0x37, 0xb9, 0x01,
|
||||
0xcd, 0x43, 0xee, 0x9f, 0x09, 0x54, 0x38, 0xa8, 0x28, 0x81, 0x42, 0x3b, 0x08, 0x5e, 0x28, 0x2f,
|
||||
0x6d, 0x56, 0x02, 0xa4, 0x0b, 0xad, 0xd3, 0x60, 0x2c, 0xbe, 0xcc, 0x79, 0x94, 0xe5, 0x63, 0xaf,
|
||||
0x86, 0xbb, 0xab, 0x10, 0xb9, 0x02, 0x6b, 0x8f, 0xc3, 0xd1, 0x71, 0x10, 0x79, 0xcd, 0xae, 0xb5,
|
||||
0xeb, 0x30, 0x2d, 0x19, 0x9c, 0x4f, 0x3d, 0x28, 0x71, 0x3e, 0x2d, 0xc2, 0x6d, 0xcd, 0x87, 0xfb,
|
||||
0x28, 0x1e, 0x64, 0x3c, 0x1a, 0xf1, 0x64, 0xf4, 0x34, 0x10, 0xcf, 0xbd, 0x75, 0x15, 0xee, 0x3c,
|
||||
0x2a, 0xf7, 0x1e, 0xf0, 0x54, 0x78, 0x6d, 0xb4, 0x88, 0xdf, 0xe4, 0x1a, 0x34, 0x0e, 0x82, 0xac,
|
||||
0x27, 0x26, 0xd9, 0x99, 0xb7, 0xd1, 0xb5, 0x76, 0x5d, 0x56, 0xc8, 0x64, 0x1b, 0x6a, 0x03, 0x9f,
|
||||
0x87, 0xc2, 0xdb, 0xc4, 0x0d, 0x4a, 0x20, 0x14, 0xd6, 0xef, 0xc7, 0x89, 0x08, 0x9e, 0x45, 0x58,
|
||||
0x04, 0xaf, 0x83, 0x41, 0xcd, 0x61, 0xe4, 0x6d, 0x70, 0x64, 0x48, 0x5b, 0x5d, 0x6b, 0xb7, 0x75,
|
||||
0xa7, 0xb5, 0x37, 0x19, 0xee, 0xf5, 0x84, 0x1f, 0x8c, 0x79, 0xc8, 0x24, 0x8e, 0x6a, 0x3e, 0xf5,
|
||||
0xc8, 0x32, 0x35, 0x9f, 0x52, 0x0a, 0x1b, 0xfd, 0xf1, 0x24, 0x4e, 0x32, 0x26, 0xd2, 0x49, 0x1c,
|
||||
0xa5, 0x82, 0x74, 0xc0, 0x39, 0x4a, 0x12, 0xcf, 0x42, 0x57, 0xf2, 0x93, 0x7e, 0x03, 0x9d, 0x83,
|
||||
0x30, 0xf6, 0xcf, 0x7b, 0x3c, 0xe3, 0x4c, 0x7c, 0x9d, 0x8b, 0x34, 0x93, 0x7c, 0x15, 0x25, 0xb5,
|
||||
0x4e, 0x09, 0x12, 0xc5, 0x1a, 0x7b, 0xb6, 0x42, 0x51, 0x90, 0xb9, 0xc0, 0x4c, 0xa9, 0x92, 0xe0,
|
||||
0x37, 0xc6, 0x7b, 0xc6, 0x93, 0x11, 0xd6, 0xd1, 0x65, 0x4a, 0x90, 0x28, 0x7a, 0xc2, 0xda, 0xbb,
|
||||
0x4c, 0x09, 0xb4, 0x0f, 0x5b, 0x15, 0xff, 0x9a, 0xe6, 0x15, 0x58, 0x63, 0xf1, 0xf3, 0x7e, 0x2f,
|
||||
0xf5, 0xac, 0xae, 0xb3, 0xeb, 0x32, 0x2d, 0x61, 0x93, 0xc4, 0x61, 0x3e, 0x8e, 0xa4, 0xca, 0x46,
|
||||
0x55, 0x09, 0xd0, 0xab, 0x50, 0xc3, 0x8e, 0x91, 0x51, 0x96, 0x7b, 0xe5, 0x27, 0xfd, 0xd6, 0x82,
|
||||
0xe6, 0x31, 0x9f, 0x22, 0x91, 0x94, 0xdc, 0x85, 0x86, 0xa9, 0x27, 0x2e, 0x6a, 0xdd, 0xb9, 0x2e,
|
||||
0x73, 0x57, 0x2c, 0xd8, 0x33, 0xda, 0xa3, 0x28, 0x4b, 0x66, 0xac, 0x58, 0x7c, 0xed, 0x53, 0x68,
|
||||
0xcf, 0xa9, 0xa4, 0xa7, 0x73, 0x31, 0x33, 0xf9, 0x3c, 0x17, 0x33, 0x19, 0xe5, 0x05, 0x0f, 0x73,
|
||||
0x81, 0x59, 0x72, 0x99, 0x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0x25, 0x90, 0x1b, 0x2a, 0x6a, 0x1d, 0x5e, 0x43, 0x72, 0x91, 0x32, 0x43, 0x94, 0xce, 0x00,
|
||||
0x0c, 0x93, 0x3c, 0x2d, 0xd6, 0x5a, 0xcb, 0xd6, 0x12, 0x6a, 0xda, 0x47, 0x1f, 0x51, 0x90, 0x7a,
|
||||
0x85, 0x30, 0xd3, 0x58, 0xef, 0x97, 0x8d, 0xa5, 0xea, 0xb9, 0x59, 0xd4, 0x5d, 0xf9, 0x28, 0xdb,
|
||||
0xeb, 0x0c, 0x5a, 0x15, 0x7c, 0x69, 0x8f, 0xdd, 0x2a, 0x9a, 0xc3, 0x2e, 0x8d, 0x21, 0xa2, 0x8d,
|
||||
0x69, 0xf5, 0x8a, 0xe1, 0x14, 0x40, 0xab, 0xb2, 0x69, 0xa9, 0xa7, 0x5d, 0xd8, 0x9c, 0x3f, 0xf0,
|
||||
0xe6, 0xce, 0x59, 0x84, 0x57, 0xb8, 0xfa, 0xd1, 0x82, 0xf6, 0x61, 0x98, 0xa7, 0x99, 0x48, 0x8a,
|
||||
0x9c, 0x36, 0x35, 0x50, 0x94, 0xb6, 0x04, 0x96, 0x57, 0x97, 0xec, 0x40, 0x4d, 0x66, 0x5c, 0x1d,
|
||||
0xee, 0x6a, 0x21, 0x14, 0x5c, 0xa9, 0x84, 0xfb, 0xba, 0x4a, 0xd0, 0xa7, 0xd0, 0x38, 0x18, 0xf4,
|
||||
0x1f, 0x24, 0x71, 0x3e, 0x59, 0x1a, 0xb1, 0x79, 0xb6, 0xd9, 0x95, 0x67, 0x5b, 0x47, 0x3d, 0x41,
|
||||
0x54, 0x54, 0xf8, 0xea, 0xe8, 0xa8, 0x57, 0x87, 0xab, 0x11, 0x3e, 0xa5, 0x03, 0xd8, 0x52, 0xe1,
|
||||
0xca, 0x89, 0x73, 0x99, 0xb1, 0x68, 0x5e, 0x11, 0x4e, 0xf9, 0x8a, 0x90, 0x46, 0xd5, 0xd4, 0xfd,
|
||||
0x2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 0x03,
|
||||
0x68, 0x9c, 0xc6, 0x93, 0x38, 0x8c, 0x9f, 0xcd, 0x56, 0x8c, 0x0c, 0x0f, 0xea, 0xea, 0x6a, 0x50,
|
||||
0x23, 0xaa, 0xc9, 0x8c, 0x48, 0xff, 0x2f, 0xfb, 0xdd, 0xe7, 0xa1, 0x9f, 0x87, 0x3c, 0x13, 0xf8,
|
||||
0x3e, 0x46, 0xf0, 0x8b, 0x98, 0x8f, 0xd4, 0x54, 0xd0, 0x47, 0x8b, 0x7e, 0xa5, 0x1b, 0x90, 0x63,
|
||||
0x38, 0x95, 0x2b, 0x68, 0x1f, 0x01, 0x73, 0x05, 0x29, 0x89, 0x7c, 0x08, 0xad, 0xca, 0x6a, 0x1d,
|
||||
0xd6, 0x66, 0xd1, 0xa7, 0x0a, 0x66, 0xd5, 0x35, 0xf4, 0x57, 0x6b, 0x6e, 0xcf, 0x2b, 0x77, 0xae,
|
||||
0x76, 0x75, 0xa1, 0x92, 0xd4, 0x60, 0x5a, 0x92, 0xa1, 0x1f, 0x4d, 0xfd, 0x30, 0x4f, 0xa5, 0x4a,
|
||||
0x5f, 0xb8, 0x05, 0x20, 0x43, 0x97, 0xff, 0x81, 0x71, 0x6e, 0x1e, 0x37, 0x46, 0x94, 0xbf, 0x64,
|
||||
0x3d, 0xc1, 0x47, 0x61, 0x10, 0x09, 0xec, 0x17, 0x87, 0x15, 0x32, 0xb9, 0xad, 0x66, 0xac, 0x69,
|
||||
0xf4, 0xed, 0x05, 0xe2, 0xa8, 0x53, 0x93, 0x37, 0xa5, 0x04, 0x3a, 0x8b, 0x2a, 0xba, 0x0d, 0x44,
|
||||
0x75, 0xc0, 0xfe, 0x30, 0x4e, 0xcc, 0x6d, 0x4b, 0x0f, 0xcd, 0x70, 0x91, 0xd9, 0x5f, 0x75, 0x89,
|
||||
0x97, 0x99, 0xb5, 0xab, 0x99, 0x3d, 0xe8, 0xfc, 0xf6, 0x72, 0xc7, 0xfa, 0xe3, 0xe5, 0x8e, 0xf5,
|
||||
0xe7, 0xcb, 0x1d, 0xeb, 0x97, 0xbf, 0x76, 0xfe, 0x37, 0x5c, 0xc3, 0xdf, 0xf5, 0x8f, 0xfe, 0x0e,
|
||||
0x00, 0x00, 0xff, 0xff, 0x77, 0x8c, 0x9b, 0xf7, 0xd1, 0x0f, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *IndexMeta) Marshal() (dAtA []byte, err error) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package internal;
|
||||
package pb;
|
||||
|
||||
import "public.proto";
|
||||
|
||||
|
|
@ -1,7 +1,24 @@
|
|||
// Copyright 2017 Pilosa Corp.
|
||||
//
|
||||
// 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 ctl contains all pilosa subcommands other than 'server'. These are
|
||||
// generally administration, testing, and debugging tools.
|
||||
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: public.proto
|
||||
|
||||
package internal
|
||||
package pb
|
||||
|
||||
import (
|
||||
encoding_binary "encoding/binary"
|
||||
|
|
@ -2726,162 +2743,160 @@ func (m *GroupCounts) GetGroups() []*GroupCount {
|
|||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Row)(nil), "internal.Row")
|
||||
proto.RegisterType((*RowMatrix)(nil), "internal.RowMatrix")
|
||||
proto.RegisterType((*SignedRow)(nil), "internal.SignedRow")
|
||||
proto.RegisterType((*RowIdentifiers)(nil), "internal.RowIdentifiers")
|
||||
proto.RegisterType((*IDList)(nil), "internal.IDList")
|
||||
proto.RegisterType((*ExtractedIDColumn)(nil), "internal.ExtractedIDColumn")
|
||||
proto.RegisterType((*ExtractedIDMatrix)(nil), "internal.ExtractedIDMatrix")
|
||||
proto.RegisterType((*KeyList)(nil), "internal.KeyList")
|
||||
proto.RegisterType((*ExtractedTableValue)(nil), "internal.ExtractedTableValue")
|
||||
proto.RegisterType((*ExtractedTableColumn)(nil), "internal.ExtractedTableColumn")
|
||||
proto.RegisterType((*ExtractedTableField)(nil), "internal.ExtractedTableField")
|
||||
proto.RegisterType((*ExtractedTable)(nil), "internal.ExtractedTable")
|
||||
proto.RegisterType((*Pair)(nil), "internal.Pair")
|
||||
proto.RegisterType((*PairField)(nil), "internal.PairField")
|
||||
proto.RegisterType((*PairsField)(nil), "internal.PairsField")
|
||||
proto.RegisterType((*Int64)(nil), "internal.Int64")
|
||||
proto.RegisterType((*FieldRow)(nil), "internal.FieldRow")
|
||||
proto.RegisterType((*GroupCount)(nil), "internal.GroupCount")
|
||||
proto.RegisterType((*ValCount)(nil), "internal.ValCount")
|
||||
proto.RegisterType((*Decimal)(nil), "internal.Decimal")
|
||||
proto.RegisterType((*ColumnAttrSet)(nil), "internal.ColumnAttrSet")
|
||||
proto.RegisterType((*Attr)(nil), "internal.Attr")
|
||||
proto.RegisterType((*AttrMap)(nil), "internal.AttrMap")
|
||||
proto.RegisterType((*QueryRequest)(nil), "internal.QueryRequest")
|
||||
proto.RegisterType((*QueryResponse)(nil), "internal.QueryResponse")
|
||||
proto.RegisterType((*QueryResult)(nil), "internal.QueryResult")
|
||||
proto.RegisterType((*ImportRequest)(nil), "internal.ImportRequest")
|
||||
proto.RegisterType((*ImportValueRequest)(nil), "internal.ImportValueRequest")
|
||||
proto.RegisterType((*AtomicRecord)(nil), "internal.AtomicRecord")
|
||||
proto.RegisterType((*AtomicImportResponse)(nil), "internal.AtomicImportResponse")
|
||||
proto.RegisterType((*TranslateKeysRequest)(nil), "internal.TranslateKeysRequest")
|
||||
proto.RegisterType((*TranslateKeysResponse)(nil), "internal.TranslateKeysResponse")
|
||||
proto.RegisterType((*TranslateIDsRequest)(nil), "internal.TranslateIDsRequest")
|
||||
proto.RegisterType((*TranslateIDsResponse)(nil), "internal.TranslateIDsResponse")
|
||||
proto.RegisterType((*ImportRoaringRequestView)(nil), "internal.ImportRoaringRequestView")
|
||||
proto.RegisterType((*ImportRoaringRequest)(nil), "internal.ImportRoaringRequest")
|
||||
proto.RegisterType((*ImportColumnAttrsRequest)(nil), "internal.ImportColumnAttrsRequest")
|
||||
proto.RegisterType((*GroupCounts)(nil), "internal.GroupCounts")
|
||||
proto.RegisterType((*Row)(nil), "pb.Row")
|
||||
proto.RegisterType((*RowMatrix)(nil), "pb.RowMatrix")
|
||||
proto.RegisterType((*SignedRow)(nil), "pb.SignedRow")
|
||||
proto.RegisterType((*RowIdentifiers)(nil), "pb.RowIdentifiers")
|
||||
proto.RegisterType((*IDList)(nil), "pb.IDList")
|
||||
proto.RegisterType((*ExtractedIDColumn)(nil), "pb.ExtractedIDColumn")
|
||||
proto.RegisterType((*ExtractedIDMatrix)(nil), "pb.ExtractedIDMatrix")
|
||||
proto.RegisterType((*KeyList)(nil), "pb.KeyList")
|
||||
proto.RegisterType((*ExtractedTableValue)(nil), "pb.ExtractedTableValue")
|
||||
proto.RegisterType((*ExtractedTableColumn)(nil), "pb.ExtractedTableColumn")
|
||||
proto.RegisterType((*ExtractedTableField)(nil), "pb.ExtractedTableField")
|
||||
proto.RegisterType((*ExtractedTable)(nil), "pb.ExtractedTable")
|
||||
proto.RegisterType((*Pair)(nil), "pb.Pair")
|
||||
proto.RegisterType((*PairField)(nil), "pb.PairField")
|
||||
proto.RegisterType((*PairsField)(nil), "pb.PairsField")
|
||||
proto.RegisterType((*Int64)(nil), "pb.Int64")
|
||||
proto.RegisterType((*FieldRow)(nil), "pb.FieldRow")
|
||||
proto.RegisterType((*GroupCount)(nil), "pb.GroupCount")
|
||||
proto.RegisterType((*ValCount)(nil), "pb.ValCount")
|
||||
proto.RegisterType((*Decimal)(nil), "pb.Decimal")
|
||||
proto.RegisterType((*ColumnAttrSet)(nil), "pb.ColumnAttrSet")
|
||||
proto.RegisterType((*Attr)(nil), "pb.Attr")
|
||||
proto.RegisterType((*AttrMap)(nil), "pb.AttrMap")
|
||||
proto.RegisterType((*QueryRequest)(nil), "pb.QueryRequest")
|
||||
proto.RegisterType((*QueryResponse)(nil), "pb.QueryResponse")
|
||||
proto.RegisterType((*QueryResult)(nil), "pb.QueryResult")
|
||||
proto.RegisterType((*ImportRequest)(nil), "pb.ImportRequest")
|
||||
proto.RegisterType((*ImportValueRequest)(nil), "pb.ImportValueRequest")
|
||||
proto.RegisterType((*AtomicRecord)(nil), "pb.AtomicRecord")
|
||||
proto.RegisterType((*AtomicImportResponse)(nil), "pb.AtomicImportResponse")
|
||||
proto.RegisterType((*TranslateKeysRequest)(nil), "pb.TranslateKeysRequest")
|
||||
proto.RegisterType((*TranslateKeysResponse)(nil), "pb.TranslateKeysResponse")
|
||||
proto.RegisterType((*TranslateIDsRequest)(nil), "pb.TranslateIDsRequest")
|
||||
proto.RegisterType((*TranslateIDsResponse)(nil), "pb.TranslateIDsResponse")
|
||||
proto.RegisterType((*ImportRoaringRequestView)(nil), "pb.ImportRoaringRequestView")
|
||||
proto.RegisterType((*ImportRoaringRequest)(nil), "pb.ImportRoaringRequest")
|
||||
proto.RegisterType((*ImportColumnAttrsRequest)(nil), "pb.ImportColumnAttrsRequest")
|
||||
proto.RegisterType((*GroupCounts)(nil), "pb.GroupCounts")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("public.proto", fileDescriptor_413a91106d7bcce8) }
|
||||
|
||||
var fileDescriptor_413a91106d7bcce8 = []byte{
|
||||
// 1779 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x4f, 0x6f, 0x23, 0x49,
|
||||
0x15, 0x4f, 0xbb, 0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0c, 0x7a, 0x5c, 0x93, 0xac, 0x0f, 0xcd, 0x70, 0x36, 0x16, 0x57, 0x7e, 0x73, 0xcf, 0x19,
|
||||
0x74, 0xb8, 0x22, 0x90, 0xfb, 0x49, 0x2c, 0x92, 0xb1, 0xbf, 0xa9, 0xb8, 0x44, 0x04, 0x07, 0xd0,
|
||||
0xe1, 0xe9, 0xea, 0x65, 0x24, 0xb3, 0xf8, 0x8a, 0x7d, 0x0b, 0x3c, 0x9e, 0xae, 0xd4, 0x1d, 0xbb,
|
||||
0x4f, 0xb6, 0xcc, 0xb9, 0x3c, 0x5d, 0x71, 0x12, 0x05, 0x2f, 0xa1, 0x73, 0x1e, 0x4f, 0x66, 0x62,
|
||||
0x8c, 0x6e, 0xbd, 0x07, 0xee, 0xab, 0x14, 0xd5, 0x9d, 0x75, 0x75, 0x94, 0xa0, 0xc2, 0x99, 0x98,
|
||||
0xf8, 0x8d, 0x5a, 0x85, 0x33, 0x31, 0x09, 0x9e, 0xc1, 0x36, 0x4f, 0x57, 0xe1, 0x58, 0xcc, 0x64,
|
||||
0xfc, 0x9b, 0x58, 0x64, 0x04, 0x48, 0x71, 0x07, 0x4f, 0x1d, 0x5a, 0x80, 0xd4, 0x30, 0x20, 0x05,
|
||||
0x0f, 0x61, 0x33, 0x1c, 0xfe, 0x3c, 0x5e, 0x48, 0xb6, 0x03, 0x6e, 0x38, 0xd4, 0x1b, 0x70, 0x19,
|
||||
0x84, 0xf0, 0xce, 0xc9, 0x95, 0xcc, 0xa2, 0x91, 0x14, 0xe3, 0x70, 0xa8, 0xa0, 0x66, 0xdb, 0xd0,
|
||||
0x08, 0x87, 0x74, 0x57, 0x8f, 0x37, 0xc2, 0x21, 0xdb, 0x07, 0xef, 0x22, 0x4a, 0x34, 0xc8, 0x3b,
|
||||
0xe6, 0x72, 0xca, 0x2c, 0x27, 0x69, 0x70, 0x59, 0x32, 0x95, 0xe3, 0xf4, 0x2e, 0x6c, 0x12, 0x7a,
|
||||
0xea, 0x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 0x3f, 0xcb,
|
||||
0xd2, 0xe5, 0x9c, 0x40, 0x63, 0x03, 0x68, 0x12, 0x95, 0xfb, 0xc7, 0xcc, 0x26, 0x7d, 0x37, 0xae,
|
||||
0x14, 0xea, 0x41, 0xc7, 0xe0, 0x1c, 0x4d, 0x26, 0xea, 0xa5, 0x71, 0x5c, 0x62, 0x2a, 0xb5, 0x2f,
|
||||
0xa2, 0xa4, 0x10, 0x5f, 0x44, 0x49, 0xee, 0x37, 0x2e, 0xcb, 0x66, 0x5c, 0x6d, 0xe6, 0x21, 0xb4,
|
||||
0x3f, 0x49, 0xd2, 0x48, 0xa2, 0x32, 0xda, 0x72, 0x78, 0x41, 0xb3, 0x43, 0x80, 0xa1, 0x18, 0xc5,
|
||||
0xd3, 0x28, 0x41, 0xa9, 0x57, 0x2d, 0x00, 0xb9, 0x8c, 0x5b, 0x4a, 0xc1, 0x53, 0x68, 0xe5, 0x54,
|
||||
0x3d, 0xf6, 0xc8, 0x3d, 0x1f, 0x45, 0x89, 0xd0, 0xb7, 0x20, 0x22, 0xf8, 0x0c, 0xb6, 0x54, 0x32,
|
||||
0x62, 0x6b, 0x3a, 0x17, 0xf2, 0x0e, 0xa9, 0x78, 0xa7, 0x26, 0x17, 0xfc, 0xd5, 0x01, 0x0f, 0x57,
|
||||
0xda, 0x80, 0x63, 0x0c, 0xd8, 0xaf, 0xd1, 0x53, 0xaf, 0x91, 0xed, 0x41, 0xf7, 0x5c, 0x62, 0x0f,
|
||||
0x34, 0x65, 0xac, 0xc3, 0x6d, 0x16, 0xe2, 0x15, 0xce, 0xa4, 0x09, 0xb7, 0xcb, 0x0b, 0x9a, 0x3d,
|
||||
0x82, 0x0e, 0xd6, 0x26, 0x25, 0xc4, 0x42, 0xd6, 0xe6, 0x86, 0xc1, 0x76, 0x01, 0x34, 0xb2, 0x4b,
|
||||
0x41, 0xd5, 0xcc, 0xe1, 0x16, 0x27, 0xf8, 0x10, 0x5a, 0x78, 0xd3, 0x97, 0xd1, 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b, 0x97,
|
||||
0x9b, 0xf4, 0xb7, 0xef, 0xfb, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xa8, 0x3e, 0x99, 0xfd,
|
||||
0x13, 0x00, 0x00,
|
||||
// 1754 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0x5f, 0x6f, 0x23, 0x49,
|
||||
0x11, 0xcf, 0xfc, 0xf1, 0xbf, 0xb2, 0xe3, 0xe4, 0xfa, 0x72, 0xcb, 0xdc, 0x92, 0x33, 0xbe, 0x11,
|
||||
0x3a, 0x79, 0x09, 0xca, 0x89, 0x00, 0x27, 0x38, 0x09, 0x50, 0x1c, 0xe7, 0xc8, 0x68, 0xd9, 0xdc,
|
||||
0x5e, 0x3b, 0x04, 0x1e, 0x78, 0x99, 0xd8, 0x8d, 0x6f, 0xc4, 0xd8, 0x63, 0xc6, 0xe3, 0x73, 0x22,
|
||||
0x3e, 0xc0, 0xf1, 0x11, 0x40, 0x3c, 0x23, 0xf1, 0x39, 0x78, 0x81, 0x37, 0x78, 0xe4, 0x11, 0x2d,
|
||||
0x5f, 0x04, 0x55, 0x75, 0xf7, 0x4c, 0xcf, 0xd8, 0x7b, 0xbb, 0x5a, 0xdd, 0x5b, 0xd7, 0x9f, 0xae,
|
||||
0xee, 0xfa, 0x55, 0x75, 0x55, 0xcd, 0x40, 0x67, 0xb9, 0xbe, 0x8b, 0xa3, 0xc9, 0xe9, 0x32, 0x4d,
|
||||
0xb2, 0x84, 0xd9, 0xcb, 0x3b, 0xff, 0xcf, 0x16, 0x38, 0x3c, 0xd9, 0x30, 0x0f, 0x1a, 0x17, 0x49,
|
||||
0xbc, 0x9e, 0x2f, 0x56, 0x9e, 0xd5, 0x77, 0x06, 0x2e, 0xd7, 0x24, 0x63, 0xe0, 0x3e, 0x15, 0x0f,
|
||||
0x2b, 0xcf, 0xe9, 0x3b, 0x83, 0x16, 0xa7, 0x35, 0xeb, 0x41, 0xed, 0x3c, 0xcb, 0xd2, 0x95, 0x67,
|
||||
0xf7, 0x9d, 0x41, 0xfb, 0xac, 0x79, 0xba, 0xbc, 0x3b, 0x45, 0x06, 0x97, 0x6c, 0xb4, 0xc6, 0x93,
|
||||
0x30, 0x8d, 0x16, 0x33, 0xcf, 0xed, 0x5b, 0x83, 0x0e, 0xd7, 0x24, 0x3b, 0x82, 0x5a, 0xb0, 0x98,
|
||||
0x8a, 0x7b, 0xaf, 0xd6, 0xb7, 0x06, 0x2d, 0x2e, 0x09, 0xe4, 0x7e, 0x12, 0x89, 0x78, 0xea, 0xd5,
|
||||
0x25, 0x97, 0x08, 0x7f, 0x00, 0x2d, 0x9e, 0x6c, 0x9e, 0x85, 0x59, 0x1a, 0xdd, 0xb3, 0x6f, 0x82,
|
||||
0xcb, 0x93, 0x8d, 0xbc, 0x5d, 0xfb, 0xac, 0x81, 0x27, 0xf2, 0x64, 0xc3, 0x89, 0xe9, 0x9f, 0x43,
|
||||
0x6b, 0x1c, 0xcd, 0x16, 0x62, 0x8a, 0xae, 0xbc, 0x0b, 0xce, 0xf3, 0x04, 0x15, 0x2d, 0x53, 0x11,
|
||||
0x79, 0x28, 0xba, 0x16, 0x33, 0xcf, 0xae, 0x88, 0xae, 0xc5, 0xcc, 0xff, 0x11, 0x74, 0x79, 0xb2,
|
||||
0x09, 0xa6, 0x62, 0x91, 0x45, 0xbf, 0x8d, 0x44, 0x4a, 0x8e, 0xe7, 0x27, 0xba, 0xf2, 0xa0, 0x1c,
|
||||
0x0c, 0xbb, 0x00, 0xc3, 0x7f, 0x0c, 0xf5, 0x60, 0xf4, 0x8b, 0x68, 0x95, 0xb1, 0x43, 0x70, 0x82,
|
||||
0x91, 0xde, 0x80, 0x4b, 0xff, 0x02, 0xde, 0xba, 0xbc, 0xcf, 0xd2, 0x70, 0x92, 0x89, 0x69, 0x30,
|
||||
0x92, 0x90, 0xb2, 0x2e, 0xd8,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04, 0x3b, 0xa4, 0x50, 0xd9, 0xea, 0x7c, 0x0c, 0xd6, 0x87, 0x50, 0x27, 0x33, 0xf2, 0x41,
|
||||
0xb4, 0xcf, 0xbe, 0x51, 0x82, 0xb7, 0x00, 0x88, 0x2b, 0xb5, 0x61, 0x8b, 0xf0, 0xfd, 0x34, 0x0d,
|
||||
0x46, 0xfe, 0x4f, 0xaa, 0x50, 0x52, 0xcc, 0x10, 0xf6, 0xeb, 0x70, 0x2e, 0xe4, 0xc9, 0x9c, 0xd6,
|
||||
0xc8, 0xbb, 0x79, 0x58, 0x0a, 0x3a, 0xba, 0xc5, 0x69, 0xed, 0xaf, 0xa1, 0x5b, 0xde, 0x8e, 0x97,
|
||||
0x31, 0x92, 0x60, 0xe7, 0x65, 0x48, 0x9e, 0x67, 0xc7, 0x59, 0x35, 0x3b, 0xbc, 0xed, 0x1d, 0xd5,
|
||||
0x04, 0xf9, 0x29, 0xb8, 0xcf, 0xc3, 0x28, 0xdd, 0x4a, 0xdb, 0x43, 0x89, 0x97, 0x43, 0x37, 0x74,
|
||||
0x24, 0xf0, 0xb5, 0x8b, 0x64, 0xbd, 0xc8, 0x24, 0x60, 0x5c, 0x12, 0xfe, 0xcf, 0xa0, 0x85, 0xfb,
|
||||
0xa5, 0xaf, 0xc7, 0xd2, 0x98, 0xca, 0x1b, 0x2a, 0x1c, 0x48, 0x73, 0x79, 0x44, 0x5e, 0x07, 0x6c,
|
||||
0xb3, 0x0e, 0x0c, 0x01, 0x50, 0xba, 0x92, 0x16, 0x7a, 0x50, 0x23, 0x4a, 0xb9, 0x5c, 0x98, 0x90,
|
||||
0xec, 0x97, 0xd8, 0x78, 0x0f, 0xeb, 0x4e, 0xf6, 0xd1, 0x0f, 0x50, 0x2c, 0x33, 0x0e, 0x6f, 0xe0,
|
||||
0x70, 0x95, 0x13, 0x09, 0x34, 0x25, 0x50, 0xc9, 0xa6, 0x30, 0x60, 0x19, 0x06, 0x90, 0x8b, 0xf5,
|
||||
0x61,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 0x2d,
|
||||
0xac, 0x31, 0x52, 0x88, 0x05, 0xa9, 0xc9, 0x0b, 0x06, 0xeb, 0x01, 0x68, 0x34, 0xd7, 0x82, 0xaa,
|
||||
0x92, 0xc5, 0x0d, 0x8e, 0xff, 0x04, 0x1a, 0x78, 0xd3, 0x67, 0xe1, 0xb2, 0xf0, 0xca, 0xda, 0xed,
|
||||
0xd5, 0x5f, 0x6c, 0xe8, 0x7c, 0xb6, 0x16, 0xe9, 0x03, 0x17, 0xbf, 0x5f, 0x8b, 0x55, 0x86, 0x78,
|
||||
0x12, 0xad, 0x93, 0x95, 0x08, 0x4c, 0xcb, 0xf1, 0xe7, 0x61, 0x3a, 0x95, 0xe8, 0xb8, 0x5c, 0x51,
|
||||
0xe8, 0x65, 0x81, 0xf3, 0x8a, 0xbc, 0x6c, 0x72, 0x93, 0x45, 0x09, 0x2d, 0xe6, 0x49, 0xa6, 0xdd,
|
||||
0x50, 0x14, 0x1b, 0xc0, 0xc1, 0xe5, 0xfd, 0x24, 0x5e, 0x4f, 0x05, 0x4f, 0x36, 0x72, 0x37, 0x95,
|
||||
0x57, 0x5e, 0x65, 0xb3, 0x0f, 0xb0, 0x4a, 0x11, 0x4b, 0x57, 0x9a, 0x06, 0x29, 0x56, 0xb8, 0xec,
|
||||
0x04, 0x3a, 0x97, 0xf3, 0x3b, 0x31, 0x9d, 0x8a, 0xe9, 0x28, 0xcc, 0x42, 0xaf, 0x59, 0x6e, 0xec,
|
||||
0x25, 0x21, 0xfb, 0x36, 0xec, 0x3f, 0x4f, 0xc5, 0x4d, 0x1a, 0x2e, 0x56, 0x71, 0x98, 0x89, 0xa9,
|
||||
0xd7, 0x22, 0x9b, 0x65, 0xa6, 0xff, 0xa5, 0x05, 0xfb, 0x0a, 0x9d, 0xd5, 0x32, 0x59, 0xac, 0x04,
|
||||
0x06, 0xff, 0x32, 0x4d, 0x75, 0xf0, 0x2f, 0xd3, 0x94, 0x3d, 0x81, 0x06, 0x17, 0xab, 0x75, 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b4, 0xa9, 0x3a,
|
||||
0x56, 0x49, 0x21, 0xdf, 0x31, 0xa9, 0x7d, 0x5c, 0x6d, 0xdb, 0x5e, 0xb7, 0x80, 0xa2, 0x2c, 0xe1,
|
||||
0xd5, 0x06, 0x7f, 0x62, 0x8c, 0xc0, 0xde, 0x41, 0x71, 0xdb, 0x9c, 0xc9, 0x8d, 0x11, 0xf9, 0x7b,
|
||||
0xd0, 0x36, 0x03, 0x75, 0x48, 0xea, 0x07, 0xe5, 0x40, 0xad, 0xb8, 0xa9, 0xe3, 0xff, 0xc3, 0x86,
|
||||
0xfd, 0x60, 0xbe, 0x4c, 0xd2, 0xcc, 0x28, 0x28, 0x72, 0x40, 0xb7, 0x76, 0x0e, 0xe8, 0x76, 0xa5,
|
||||
0x27, 0x52, 0x61, 0xa1, 0x42, 0xe2, 0x72, 0x49, 0x18, 0xa9, 0xe4, 0x96, 0x52, 0xe9, 0x18, 0x5a,
|
||||
0xf2, 0x95, 0xa0, 0xa8, 0x46, 0xa2, 0x82, 0x21, 0x3f, 0x19, 0x36, 0x34, 0x32, 0x36, 0x68, 0xfc,
|
||||
0xd4, 0x24, 0x96, 0x4f, 0xa9, 0x46, 0xc2, 0x26, 0x09, 0x0d, 0x0e, 0xca, 0x6f, 0xa2, 0xb9, 0x58,
|
||||
0x65, 0xe1, 0x7c, 0x89, 0x55, 0xc9, 0x19, 0x38, 0xdc, 0xe0, 0x60, 0x41, 0x22, 0x27, 0x2e, 0x52,
|
||||
0x81, 0x55, 0xe2, 0x3c, 0xa3, 0x54, 0x74, 0x78, 0x85, 0x8b, 0x7a, 0xe4, 0x56, 0xa1, 0x07, 0x52,
|
||||
0xaf, 0xcc, 0xa5, 0x16, 0x1a, 0x8b, 0x30, 0xa5, 0x64, 0x6b, 0x72, 0x49, 0xf8, 0xff, 0xb1, 0x81,
|
||||
0x49, 0x24, 0xe5, 0xf8, 0xf7, 0xb5, 0xc1, 0xf9, 0xd5, 0xb0, 0x95, 0xc1, 0x69, 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xbf, 0x5f, 0xf4, 0xac, 0xff, 0xbe, 0xe8,
|
||||
0x59, 0x7f, 0xfa, 0x5f, 0x6f, 0xef, 0xae, 0x4e, 0xff, 0xc1, 0xbe, 0xff, 0xff, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0x7b, 0x22, 0x9e, 0xfd, 0x17, 0x13, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Row) Marshal() (dAtA []byte, err error) {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package internal;
|
||||
package pb;
|
||||
|
||||
message Row {
|
||||
repeated uint64 Columns = 1;
|
||||
|
|
@ -34,7 +34,8 @@ var (
|
|||
ErrIndexExists = disco.ErrIndexExists
|
||||
ErrIndexNotFound = errors.New("index not found")
|
||||
|
||||
ErrInvalidSchema = errors.New("invalid schema")
|
||||
ErrInvalidAddress = errors.New("invalid address")
|
||||
ErrInvalidSchema = errors.New("invalid schema")
|
||||
|
||||
ErrForeignIndexNotFound = errors.New("foreign index not found")
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func TestAddressWithDefaults(t *testing.T) {
|
|||
{addr: "1.2.3.4:", expected: "1.2.3.4:10101"},
|
||||
{addr: "1.2.3.4:55555", expected: "1.2.3.4:55555"},
|
||||
// The following tests check the error conditions.
|
||||
{addr: "[invalid][addr]:port", err: "invalid address"},
|
||||
{addr: "[invalid][addr]:port", err: pilosa.ErrInvalidAddress.Error()},
|
||||
}
|
||||
for _, test := range tests {
|
||||
actual, err := pilosa.AddressWithDefaults(test.addr)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ func newCommand(tb testing.TB, opts ...server.CommandOption) *Command {
|
|||
}
|
||||
|
||||
// Set aggressive close timeout by default to avoid hanging tests. This was
|
||||
// a problem with PDK tests which used go-pilosa as well. We put it at the
|
||||
// a problem with PDK tests which used pilosa/client as well. We put it at the
|
||||
// beginning of the option slice so that it can be overridden by user-passed
|
||||
// options.
|
||||
// Also set TranslateFile MapSize to a smaller number so memory allocation
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue