Documentation
¶
Index ¶
- Constants
- func BenchmarkAttrStore_Duplicate(b *testing.B)
- func GenerateImportFill(rowN int, pct float64) (rowIDs, columnIDs []uint64)
- func MustDo(method, urlStr string, body string) *httpResponse
- func MustMarshalJSON(v interface{}) []byte
- func MustNewHTTPRequest(method, urlStr string, body io.Reader) *http.Request
- func MustOpenAttrStore() pilosa.AttrStore
- func MustParse(s string) *pql.Query
- func MustParseURLHost(rawurl string) string
- func MustReadAll(r io.Reader) []byte
- func NewAttrStore(string) pilosa.AttrStore
- func NewCluster(n int) *pilosa.Cluster
- func NewURI(scheme, host string, port uint16) pilosa.URI
- func NewURIFromHostPort(host string, port uint16) pilosa.URI
- func TestFrame_SetCacheSize(t *testing.T)
- type AttrStore
- type BufferLogger
- 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 Main
- func (m *Main) Client() *pilosa.InternalHTTPClient
- func (m *Main) Close() error
- func (m *Main) CreateDefinition(index, def, query string) (string, error)
- func (m *Main) Query(index, rawQuery, query string) (string, error)
- func (m *Main) RecalculateCaches() error
- func (m *Main) Reopen() error
- func (m *Main) RunWithTransport(host string, bindPort int, joinSeeds []string) (seed string, err error)
- func (m *Main) URL() string
- type MainOpt
- type ModHasher
- type RowAttrStore
- type Server
- type TestCluster
- func (t *TestCluster) AddNode(saveTopology bool) error
- func (t *TestCluster) Close() error
- func (t *TestCluster) CreateFrame(index, frame string, opt pilosa.FrameOptions) error
- func (t *TestCluster) CreateIndex(name string) error
- func (t *TestCluster) FollowResizeInstruction(instr *internal.ResizeInstruction) error
- func (t *TestCluster) Open() error
- func (t *TestCluster) SendAsync(pb proto.Message) error
- func (t *TestCluster) SendSync(pb proto.Message) error
- func (t *TestCluster) SendTo(to *pilosa.Node, pb proto.Message) error
- func (t *TestCluster) SetBit(index, frame, view string, rowID, colID uint64, x *time.Time) error
- func (t *TestCluster) SetFieldValue(index, frame string, columnID uint64, name string, value int64) error
- func (t *TestCluster) SetState(state string)
- func (t *TestCluster) WriteTopology(path string, top *pilosa.Topology) error
Constants ¶
const SliceWidth = pilosa.SliceWidth
SliceWidth is a helper reference to use when testing.
Variables ¶
This section is empty.
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 MustOpenAttrStore ¶ added in v0.5.0
MustOpenAttrStore returns a new, opened attribute store at a temporary path. 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 NewAttrStore ¶ added in v0.5.0
NewAttrStore returns a new instance of AttrStore.
func NewCluster ¶ added in v0.5.0
NewCluster returns a cluster with n nodes and uses a mod-based hasher.
func NewURIFromHostPort ¶ added in v0.9.0
func TestFrame_SetCacheSize ¶ added in v0.5.0
Ensure frame can set its cache
Types ¶
type BufferLogger ¶ added in v0.9.0
type BufferLogger struct {
// contains filtered or unexported fields
}
BufferLogger represents a test Logger that holds log messages in a buffer for review.
func NewBufferLogger ¶ added in v0.9.0
func NewBufferLogger() *BufferLogger
NewBufferLogger returns a new instance of BufferLogger.
func (*BufferLogger) Debugf ¶ added in v0.9.0
func (b *BufferLogger) Debugf(format string, v ...interface{})
func (*BufferLogger) Printf ¶ added in v0.9.0
func (b *BufferLogger) Printf(format string, v ...interface{})
func (*BufferLogger) ReadAll ¶ added in v0.9.0
func (b *BufferLogger) ReadAll() ([]byte, error)
type Client ¶ added in v0.5.0
type Client struct {
*pilosa.InternalHTTPClient
}
Client represents a test wrapper for pilosa.Client.
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 Main ¶ added in v0.9.0
////////////////////////////////////////////////////////////////////////////////// Main represents a test wrapper for main.Main.
func MustRunMain ¶ added in v0.9.0
func MustRunMain() *Main
MustRunMain returns a new, running Main. Panic on error.
func MustRunMainWithCluster ¶ added in v0.9.0
MustRunMainWithCluster ruturns a running array of *Main where all nodes are joined via memberlist (i.e. clustering enabled).
func NewMain ¶ added in v0.9.0
NewMain returns a new instance of Main with a temporary data directory and random port.
func NewMainWithCluster ¶ added in v0.9.0
NewMainWithCluster returns a new instance of Main with clustering enabled.
func (*Main) Client ¶ added in v0.9.0
func (m *Main) Client() *pilosa.InternalHTTPClient
Client returns a client to connect to the program.
func (*Main) Close ¶ added in v0.9.0
Close closes the program and removes the underlying data directory.
func (*Main) CreateDefinition ¶ added in v0.9.0
CreateDefinition.
func (*Main) Query ¶ added in v0.9.0
Query executes a query against the program through the HTTP API.
func (*Main) RecalculateCaches ¶ added in v0.9.0
type MainOpt ¶ added in v0.9.0
func OptAntiEntropyInterval ¶ added in v0.9.0
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 exists so that test.Server implements StatusHandler.
func (*Server) HandleRemoteStatus ¶ added in v0.5.0
HandleRemoteStatus just need to implement a nop to complete the Interface
type TestCluster ¶ added in v0.9.0
TestCluster represents a cluster of test nodes, each of which has a pilosa.Cluster.
func NewTestCluster ¶ added in v0.9.0
func NewTestCluster(n int) *TestCluster
NewTestCluster returns a new instance of test.Cluster.
func (*TestCluster) AddNode ¶ added in v0.9.0
func (t *TestCluster) AddNode(saveTopology bool) error
AddNode adds a node to the cluster and (potentially) starts a resize job.
func (*TestCluster) Close ¶ added in v0.9.0
func (t *TestCluster) Close() error
Close closes all clusters in the test cluster.
func (*TestCluster) CreateFrame ¶ added in v0.9.0
func (t *TestCluster) CreateFrame(index, frame string, opt pilosa.FrameOptions) error
func (*TestCluster) CreateIndex ¶ added in v0.9.0
func (t *TestCluster) CreateIndex(name string) error
func (*TestCluster) FollowResizeInstruction ¶ added in v0.9.0
func (t *TestCluster) FollowResizeInstruction(instr *internal.ResizeInstruction) error
FollowResizeInstruction is a version of cluster.FollowResizeInstruction used for testing.
func (*TestCluster) Open ¶ added in v0.9.0
func (t *TestCluster) Open() error
Open opens all clusters in the test cluster.
func (*TestCluster) SendAsync ¶ added in v0.9.0
func (t *TestCluster) SendAsync(pb proto.Message) error
SendAsync is a test implemenetation of Broadcaster SendAsync method.
func (*TestCluster) SendSync ¶ added in v0.9.0
func (t *TestCluster) SendSync(pb proto.Message) error
SendSync is a test implemenetation of Broadcaster SendSync method.
func (*TestCluster) SendTo ¶ added in v0.9.0
SendTo is a test implemenetation of Broadcaster SendTo method.
func (*TestCluster) SetFieldValue ¶ added in v0.9.0
func (*TestCluster) SetState ¶ added in v0.9.0
func (t *TestCluster) SetState(state string)
SetState sets the state of the cluster on each node.
func (*TestCluster) WriteTopology ¶ added in v0.9.0
func (t *TestCluster) WriteTopology(path string, top *pilosa.Topology) error
WriteTopology writes the given topology to disk.