Documentation ¶
Index ¶
- Constants
- Variables
- func BenchmarkAttrStore_Duplicate(b *testing.B)
- func GenerateImportFill(rowN int, pct float64) (rowIDs, columnIDs []uint64)
- func MustMarshalJSON(v interface{}) []byte
- func MustNewHTTPRequest(method, urlStr string, body io.Reader) *http.Request
- func MustParse(s string) *pql.Query
- func MustParseURLHost(rawurl string) string
- func MustReadAll(r io.Reader) []byte
- func NewCluster(n int) *pilosa.Cluster
- func TestFrame_SetCacheSize(t *testing.T)
- type AttrStore
- type Client
- type ConstHasher
- type Executor
- type Fragment
- type Frame
- type Handler
- type HandlerExecutor
- type Holder
- func (h *Holder) Close() error
- func (h *Holder) MustCreateFragmentIfNotExists(index, frame, view string, slice uint64) *Fragment
- func (h *Holder) MustCreateFrameIfNotExists(index, frame string) *Frame
- func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOptions) *Index
- func (h *Holder) MustCreateRankedFragmentIfNotExists(index, frame, view string, slice uint64) *Fragment
- func (h *Holder) Reopen() error
- type Index
- type ModHasher
- type RowAttrStore
- type Server
Constants ¶
const SliceWidth = pilosa.SliceWidth
SliceWidth is a helper reference to use when testing.
Variables ¶
var (
Network = flag.String("network", "tcp", "network name")
)
Test flags.
Functions ¶
func BenchmarkAttrStore_Duplicate ¶ added in v0.5.0
func GenerateImportFill ¶ added in v0.5.0
GenerateImportFill generates a set of bits pairs that evenly fill a fragment chunk.
func MustMarshalJSON ¶ added in v0.5.0
func MustMarshalJSON(v interface{}) []byte
MustMarshalJSON marshals v to JSON. Panic on error.
func MustNewHTTPRequest ¶ added in v0.5.0
MustNewHTTPRequest creates a new HTTP request. Panic on error.
func MustParseURLHost ¶ added in v0.5.0
MustParseURLHost parses rawurl and returns the hostname. Panic on error.
func MustReadAll ¶ added in v0.5.0
MustReadAll reads a reader into a buffer and returns it. Panic on error.
func NewCluster ¶ added in v0.5.0
NewCluster returns a cluster with n nodes and uses a mod-based hasher.
func TestFrame_SetCacheSize ¶ added in v0.5.0
Ensure frame can set its cache
Types ¶
type AttrStore ¶ added in v0.5.0
AttrStore represents a test wrapper for pilosa.AttrStore.
func MustOpenAttrStore ¶ added in v0.5.0
func MustOpenAttrStore() *AttrStore
MustOpenAttrStore returns a new, opened attribute store at a temporary path. Panic on error.
func NewAttrStore ¶ added in v0.5.0
func NewAttrStore() *AttrStore
NewAttrStore returns a new instance of AttrStore.
type Client ¶ added in v0.5.0
Client represents a test wrapper for pilosa.Client.
func MustNewClient ¶ added in v0.5.0
MustNewClient returns a new instance of Client. Panic on error.
type ConstHasher ¶ added in v0.5.0
type ConstHasher struct {
// contains filtered or unexported fields
}
ConstHasher represents hash that always returns the same index.
func NewConstHasher ¶ added in v0.5.0
func NewConstHasher(i int) *ConstHasher
NewConstHasher returns a new instance of ConstHasher that always returns i.
type Fragment ¶ added in v0.5.0
Fragment is a test wrapper for pilosa.Fragment.
func MustOpenFragment ¶ added in v0.5.0
MustOpenFragment creates and opens an fragment at a temporary path. Panic on error.
func NewFragment ¶ added in v0.5.0
NewFragment returns a new instance of Fragment with a temporary path.
func (*Fragment) MustClearBits ¶ added in v0.5.0
MustClearBits clears bits on a row. Panic on error.
func (*Fragment) MustSetBits ¶ added in v0.5.0
MustSetBits sets bits on a row. Panic on error. This function does not accept a timestamp or quantum.
type Frame ¶ added in v0.5.0
Frame represents a test wrapper for pilosa.Frame.
func MustOpenFrame ¶ added in v0.5.0
func MustOpenFrame() *Frame
MustOpenFrame returns a new, opened frame at a temporary path. Panic on error.
func NewFrame ¶ added in v0.5.0
func NewFrame() *Frame
NewFrame returns a new instance of Frame d/0.
func (*Frame) MustSetBit ¶ added in v0.5.0
MustSetBit sets a bit on the frame. Panic on error.
type Handler ¶ added in v0.5.0
type Handler struct { *pilosa.Handler Executor HandlerExecutor }
Handler represents a test wrapper for pilosa.Handler.
func NewHandler ¶ added in v0.5.0
func NewHandler() *Handler
NewHandler returns a new instance of Handler.
type HandlerExecutor ¶ added in v0.5.0
type HandlerExecutor struct { ExecuteFn func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) // contains filtered or unexported fields }
HandlerExecutor is a mock implementing pilosa.Handler.Executor.
func (*HandlerExecutor) Cluster ¶ added in v0.5.0
func (c *HandlerExecutor) Cluster() *pilosa.Cluster
type Holder ¶ added in v0.5.0
Holder is a test wrapper for pilosa.Holder.
func MustOpenHolder ¶ added in v0.5.0
func MustOpenHolder() *Holder
MustOpenHolder creates and opens a holder at a temporary path. Panic on error.
func NewHolder ¶ added in v0.5.0
func NewHolder() *Holder
NewHolder returns a new instance of Holder with a temporary path.
func (*Holder) MustCreateFragmentIfNotExists ¶ added in v0.5.0
MustCreateFragmentIfNotExists returns a given fragment. Panic on error.
func (*Holder) MustCreateFrameIfNotExists ¶ added in v0.5.0
MustCreateFrameIfNotExists returns a given frame. Panic on error.
func (*Holder) MustCreateIndexIfNotExists ¶ added in v0.5.0
func (h *Holder) MustCreateIndexIfNotExists(index string, opt pilosa.IndexOptions) *Index
MustCreateIndexIfNotExists returns a given index. Panic on error.
type Index ¶ added in v0.5.0
Index represents a test wrapper for pilosa.Index.
func MustOpenIndex ¶ added in v0.5.0
func MustOpenIndex() *Index
MustOpenIndex returns a new, opened index at a temporary path. Panic on error.
func (*Index) CreateFrame ¶ added in v0.5.0
CreateFrame creates a frame with the given options.
func (*Index) CreateFrameIfNotExists ¶ added in v0.5.0
CreateFrameIfNotExists creates a frame with the given options if it doesn't exist.
type ModHasher ¶ added in v0.5.0
type ModHasher struct{}
ModHasher represents a simple, mod-based hashing.
func NewModHasher ¶ added in v0.5.0
func NewModHasher() *ModHasher
NewModHasher returns a new instance of ModHasher with n buckets.
type RowAttrStore ¶ added in v0.5.0
type RowAttrStore struct {
// contains filtered or unexported fields
}
RowAttrStore provides simple storage for attributes.
func NewRowAttrStore ¶ added in v0.5.0
func NewRowAttrStore() *RowAttrStore
NewRowAttrStore returns a new instance of RowAttrStore.
func (*RowAttrStore) RowAttrs ¶ added in v0.5.0
func (s *RowAttrStore) RowAttrs(id uint64) (map[string]interface{}, error)
RowAttrs returns the attributes set to a row id.
func (*RowAttrStore) SetRowAttrs ¶ added in v0.5.0
func (s *RowAttrStore) SetRowAttrs(id uint64, m map[string]interface{})
SetRowAttrs assigns a set of attributes to a row id.
type Server ¶ added in v0.5.0
Server represents a test wrapper for httptest.Server.
func NewServer ¶ added in v0.5.0
func NewServer() *Server
NewServer returns a test server running on a random port.
func (*Server) ClusterStatus ¶ added in v0.5.0
ClusterStatus returns the NodeState for all nodes in the cluster.
func (*Server) HandleRemoteStatus ¶ added in v0.5.0
HandleRemoteStatus just need to implement a nop to complete the Interface