Documentation
¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func BleveMetaExtra(m map[string]interface{})
- func BlevePIndexImplInitRouter(r *mux.Router, phase string)
- func BlevePIndexQuerySamples() []cbgt.Documentation
- func CountAlias(mgr *cbgt.Manager, indexName, indexUUID string) (uint64, error)
- func CountBlevePIndexImpl(mgr *cbgt.Manager, indexName, indexUUID string) (uint64, error)
- func HostsForIndex(name string, planPIndexes *cbgt.PlanPIndexes, nodeDefs *cbgt.NodeDefs) []string
- func InitStaticRouter(staticDir, staticETag string) *mux.Router
- func MustAsset(name string) []byte
- func NewBlevePIndexImpl(indexType, indexParams, path string, restart func()) (cbgt.PIndexImpl, cbgt.Dest, error)
- func NewIndexStat() map[string]interface{}
- func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, ...) (*mux.Router, map[string]rest.RESTMeta, error)
- func OpenBlevePIndexImpl(indexType, path string, restart func()) (cbgt.PIndexImpl, cbgt.Dest, error)
- func QueryAlias(mgr *cbgt.Manager, indexName, indexUUID string, req []byte, res io.Writer) error
- func QueryBlevePIndexImpl(mgr *cbgt.Manager, indexName, indexUUID string, req []byte, res io.Writer) error
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func ValidateAlias(indexType, indexName, indexParams string) error
- func ValidateBlevePIndexImpl(indexType, indexName, indexParams string) error
- type AliasParams
- type AliasParamsTarget
- type BleveDest
- func (t *BleveDest) AddError(op, partition string, key []byte, seq uint64, val []byte, err error)
- func (t *BleveDest) Close() error
- func (t *BleveDest) ConsistencyWait(partition, partitionUUID string, consistencyLevel string, ...) error
- func (t *BleveDest) Count(pindex *cbgt.PIndex, cancelCh <-chan bool) (uint64, error)
- func (t *BleveDest) Dest(partition string) (cbgt.Dest, error)
- func (t *BleveDest) Query(pindex *cbgt.PIndex, req []byte, res io.Writer, cancelCh <-chan bool) error
- func (t *BleveDest) Rollback(partition string, rollbackSeq uint64) error
- func (t *BleveDest) Stats(w io.Writer) (err error)
- type BleveDestPartition
- func (t *BleveDestPartition) Close() error
- func (t *BleveDestPartition) ConsistencyWait(partition, partitionUUID string, consistencyLevel string, ...) error
- func (t *BleveDestPartition) Count(pindex *cbgt.PIndex, cancelCh <-chan bool) (uint64, error)
- func (t *BleveDestPartition) DataDelete(partition string, key []byte, seq uint64, cas uint64, ...) error
- func (t *BleveDestPartition) DataUpdate(partition string, key []byte, seq uint64, val []byte, cas uint64, ...) error
- func (t *BleveDestPartition) OpaqueGet(partition string) ([]byte, uint64, error)
- func (t *BleveDestPartition) OpaqueSet(partition string, value []byte) error
- func (t *BleveDestPartition) Query(pindex *cbgt.PIndex, req []byte, res io.Writer, cancelCh <-chan bool) error
- func (t *BleveDestPartition) Rollback(partition string, rollbackSeq uint64) error
- func (t *BleveDestPartition) SnapshotStart(partition string, snapStart, snapEnd uint64) error
- func (t *BleveDestPartition) Stats(w io.Writer) error
- type BleveParams
- type IndexClient
- func (r *IndexClient) Advanced() (index.Index, store.KVStore, error)
- func (r *IndexClient) Batch(b *bleve.Batch) error
- func (r *IndexClient) Close() error
- func (r *IndexClient) Count() (uint64, error)
- func (r *IndexClient) Delete(id string) error
- func (r *IndexClient) DeleteInternal(key []byte) error
- func (r *IndexClient) DocCount() (uint64, error)
- func (r *IndexClient) Document(id string) (*document.Document, error)
- func (r *IndexClient) DumpAll() chan interface{}
- func (r *IndexClient) DumpDoc(id string) chan interface{}
- func (r *IndexClient) DumpFields() chan interface{}
- func (r *IndexClient) FieldDict(field string) (index.FieldDict, error)
- func (r *IndexClient) FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
- func (r *IndexClient) FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
- func (r *IndexClient) Fields() ([]string, error)
- func (r *IndexClient) GetInternal(key []byte) ([]byte, error)
- func (r *IndexClient) Index(id string, data interface{}) error
- func (r *IndexClient) Mapping() *bleve.IndexMapping
- func (r *IndexClient) NewBatch() *bleve.Batch
- func (r *IndexClient) Query(buf []byte) ([]byte, error)
- func (r *IndexClient) Search(req *bleve.SearchRequest) (*bleve.SearchResult, error)
- func (r *IndexClient) SetInternal(key, val []byte) error
- func (r *IndexClient) Stats() *bleve.IndexStat
- type JSONStatsWriter
- type NSIndexStats
- type NsStatsHandler
- type NsStatusHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/
foo.txt
img/
a.png
b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func BleveMetaExtra ¶ added in v0.1.0
func BleveMetaExtra(m map[string]interface{})
func BlevePIndexImplInitRouter ¶ added in v0.1.0
func BlevePIndexQuerySamples ¶ added in v0.2.0
func BlevePIndexQuerySamples() []cbgt.Documentation
func CountBlevePIndexImpl ¶
func HostsForIndex ¶ added in v0.3.0
func InitStaticRouter ¶ added in v0.3.0
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewBlevePIndexImpl ¶
func NewIndexStat ¶ added in v0.3.0
func NewIndexStat() map[string]interface{}
NewIndexStat ensures that all index stats have the same shape and 0 values to prevent seeing N/A in ns_server UI
func NewRESTRouter ¶ added in v0.3.0
func NewRESTRouter(versionMain string, mgr *cbgt.Manager, staticDir, staticETag string, mr *cbgt.MsgRing) ( *mux.Router, map[string]rest.RESTMeta, error)
NewRESTRouter creates a mux.Router initialized with the REST API and web UI routes. See also InitStaticRouter if you need finer control of the router initialization.
func OpenBlevePIndexImpl ¶
func QueryAlias ¶
func QueryBlevePIndexImpl ¶
func RestoreAsset ¶
Restore an asset under the given directory
func RestoreAssets ¶
Restore assets under the given directory recursively
func ValidateAlias ¶
func ValidateBlevePIndexImpl ¶
Types ¶
type AliasParams ¶
type AliasParams struct {
Targets map[string]*AliasParamsTarget `json:"targets"` // Keyed by indexName.
}
AliasParams holds the definition for a user-defined index alias. A user-defined index alias can be used as a level of indirection (the "LastQuartersSales" alias points currently to the "2014-Q3-Sales" index, but the administrator might repoint it in the future without changing the application) or to scatter-gather or fan-out a query across multiple real indexes (e.g., to query across customer records, product catalog, call-center records, etc, in one shot).
type AliasParamsTarget ¶
type AliasParamsTarget struct {
IndexUUID string `json:"indexUUID"` // Optional.
}
type BleveDest ¶
type BleveDest struct {
// contains filtered or unexported fields
}
func (*BleveDest) ConsistencyWait ¶
type BleveDestPartition ¶
type BleveDestPartition struct {
// contains filtered or unexported fields
}
Used to track state for a single partition.
func (*BleveDestPartition) Close ¶
func (t *BleveDestPartition) Close() error
func (*BleveDestPartition) ConsistencyWait ¶
func (*BleveDestPartition) DataDelete ¶ added in v0.0.3
func (t *BleveDestPartition) DataDelete(partition string, key []byte, seq uint64, cas uint64, extrasType cbgt.DestExtrasType, extras []byte) error
func (*BleveDestPartition) DataUpdate ¶ added in v0.0.3
func (t *BleveDestPartition) DataUpdate(partition string, key []byte, seq uint64, val []byte, cas uint64, extrasType cbgt.DestExtrasType, extras []byte) error
func (*BleveDestPartition) OpaqueGet ¶ added in v0.0.3
func (t *BleveDestPartition) OpaqueGet(partition string) ([]byte, uint64, error)
func (*BleveDestPartition) OpaqueSet ¶ added in v0.0.3
func (t *BleveDestPartition) OpaqueSet(partition string, value []byte) error
func (*BleveDestPartition) Rollback ¶
func (t *BleveDestPartition) Rollback(partition string, rollbackSeq uint64) error
func (*BleveDestPartition) SnapshotStart ¶ added in v0.0.3
func (t *BleveDestPartition) SnapshotStart(partition string, snapStart, snapEnd uint64) error
type BleveParams ¶
type BleveParams struct {
Mapping bleve.IndexMapping `json:"mapping"`
Store map[string]interface{} `json:"store"`
}
func NewBleveParams ¶
func NewBleveParams() *BleveParams
type IndexClient ¶
type IndexClient struct {
QueryURL string
CountURL string
Consistency *cbgt.ConsistencyParams
}
IndexClient implements the Search() and DocCount() subset of the bleve.Index interface by accessing a remote cbft server via REST protocol. This allows callers to add a IndexClient as a target of a bleve.IndexAlias, and implements cbft protocol features like query consistency and auth.
TODO: Implement propagating auth info in IndexClient.
func (*IndexClient) Close ¶
func (r *IndexClient) Close() error
func (*IndexClient) Count ¶
func (r *IndexClient) Count() (uint64, error)
func (*IndexClient) Delete ¶
func (r *IndexClient) Delete(id string) error
func (*IndexClient) DeleteInternal ¶
func (r *IndexClient) DeleteInternal(key []byte) error
func (*IndexClient) DocCount ¶
func (r *IndexClient) DocCount() (uint64, error)
func (*IndexClient) Document ¶
func (r *IndexClient) Document(id string) (*document.Document, error)
func (*IndexClient) DumpAll ¶
func (r *IndexClient) DumpAll() chan interface{}
func (*IndexClient) DumpDoc ¶
func (r *IndexClient) DumpDoc(id string) chan interface{}
func (*IndexClient) DumpFields ¶
func (r *IndexClient) DumpFields() chan interface{}
func (*IndexClient) FieldDict ¶
func (r *IndexClient) FieldDict(field string) (index.FieldDict, error)
func (*IndexClient) FieldDictPrefix ¶
func (*IndexClient) FieldDictRange ¶
func (*IndexClient) Fields ¶
func (r *IndexClient) Fields() ([]string, error)
func (*IndexClient) GetInternal ¶
func (r *IndexClient) GetInternal(key []byte) ([]byte, error)
func (*IndexClient) Index ¶
func (r *IndexClient) Index(id string, data interface{}) error
func (*IndexClient) Mapping ¶
func (r *IndexClient) Mapping() *bleve.IndexMapping
func (*IndexClient) NewBatch ¶
func (r *IndexClient) NewBatch() *bleve.Batch
func (*IndexClient) Search ¶
func (r *IndexClient) Search(req *bleve.SearchRequest) ( *bleve.SearchResult, error)
func (*IndexClient) SetInternal ¶
func (r *IndexClient) SetInternal(key, val []byte) error
func (*IndexClient) Stats ¶
func (r *IndexClient) Stats() *bleve.IndexStat
type JSONStatsWriter ¶
type NSIndexStats ¶ added in v0.3.0
func (NSIndexStats) MarshalJSON ¶ added in v0.3.0
func (n NSIndexStats) MarshalJSON() ([]byte, error)
MarshalJSON formats the index stats using the colon separated convention found in other stats consumed by ns_server
type NsStatsHandler ¶ added in v0.3.0
type NsStatsHandler struct {
// contains filtered or unexported fields
}
NsStatsHandler is a REST handler that provides stats/metrics for consumption by ns_server
func NewNsStatsHandler ¶ added in v0.3.0
func NewNsStatsHandler(mgr *cbgt.Manager) *NsStatsHandler
func (*NsStatsHandler) ServeHTTP ¶ added in v0.3.0
func (h *NsStatsHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
type NsStatusHandler ¶ added in v0.3.0
type NsStatusHandler struct {
// contains filtered or unexported fields
}
NsStatusHandler is a REST handler that provides status for consumption by ns_server
func NewNsStatusHandler ¶ added in v0.3.0
func NewNsStatusHandler(mgr *cbgt.Manager, server string) (*NsStatusHandler, error)
func (*NsStatusHandler) ServeHTTP ¶ added in v0.3.0
func (h *NsStatusHandler) ServeHTTP( w http.ResponseWriter, req *http.Request)
