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 ¶ added in v0.0.1
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 ¶ added in v0.0.1
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 ¶ added in v0.0.1
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 AssetNames ¶ added in v0.0.1
func AssetNames() []string
AssetNames returns the names of the assets.
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 CountAlias ¶ added in v0.0.1
func CountBlevePIndexImpl ¶ added in v0.0.1
func HostsForIndex ¶ added in v0.3.0
func InitStaticRouter ¶ added in v0.3.0
func MustAsset ¶ added in v0.0.1
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func NewBlevePIndexImpl ¶ added in v0.0.1
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 ¶ added in v0.0.1
func QueryAlias ¶ added in v0.0.1
func QueryBlevePIndexImpl ¶ added in v0.0.1
func RestoreAsset ¶ added in v0.0.1
Restore an asset under the given directory
func RestoreAssets ¶ added in v0.0.1
Restore assets under the given directory recursively
func ValidateAlias ¶ added in v0.0.1
func ValidateBlevePIndexImpl ¶ added in v0.0.1
Types ¶
type AliasParams ¶ added in v0.0.1
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 ¶ added in v0.0.1
type AliasParamsTarget struct {
IndexUUID string `json:"indexUUID"` // Optional.
}
type BleveDest ¶ added in v0.0.1
type BleveDest struct {
// contains filtered or unexported fields
}
func NewBleveDest ¶ added in v0.0.1
func (*BleveDest) ConsistencyWait ¶ added in v0.0.1
type BleveDestPartition ¶ added in v0.0.1
type BleveDestPartition struct {
// contains filtered or unexported fields
}
Used to track state for a single partition.
func (*BleveDestPartition) Close ¶ added in v0.0.1
func (t *BleveDestPartition) Close() error
func (*BleveDestPartition) ConsistencyWait ¶ added in v0.0.1
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 ¶ added in v0.0.1
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 ¶ added in v0.0.1
type BleveParams struct { Mapping bleve.IndexMapping `json:"mapping"` Store map[string]interface{} `json:"store"` }
func NewBleveParams ¶ added in v0.0.1
func NewBleveParams() *BleveParams
type IndexClient ¶ added in v0.0.1
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 ¶ added in v0.0.1
func (r *IndexClient) Close() error
func (*IndexClient) Count ¶ added in v0.0.1
func (r *IndexClient) Count() (uint64, error)
func (*IndexClient) Delete ¶ added in v0.0.1
func (r *IndexClient) Delete(id string) error
func (*IndexClient) DeleteInternal ¶ added in v0.0.1
func (r *IndexClient) DeleteInternal(key []byte) error
func (*IndexClient) DocCount ¶ added in v0.0.1
func (r *IndexClient) DocCount() (uint64, error)
func (*IndexClient) Document ¶ added in v0.0.1
func (r *IndexClient) Document(id string) (*document.Document, error)
func (*IndexClient) DumpAll ¶ added in v0.0.1
func (r *IndexClient) DumpAll() chan interface{}
func (*IndexClient) DumpDoc ¶ added in v0.0.1
func (r *IndexClient) DumpDoc(id string) chan interface{}
func (*IndexClient) DumpFields ¶ added in v0.0.1
func (r *IndexClient) DumpFields() chan interface{}
func (*IndexClient) FieldDict ¶ added in v0.0.1
func (r *IndexClient) FieldDict(field string) (index.FieldDict, error)
func (*IndexClient) FieldDictPrefix ¶ added in v0.0.1
func (*IndexClient) FieldDictRange ¶ added in v0.0.1
func (*IndexClient) Fields ¶ added in v0.0.1
func (r *IndexClient) Fields() ([]string, error)
func (*IndexClient) GetInternal ¶ added in v0.0.1
func (r *IndexClient) GetInternal(key []byte) ([]byte, error)
func (*IndexClient) Index ¶ added in v0.0.1
func (r *IndexClient) Index(id string, data interface{}) error
func (*IndexClient) Mapping ¶ added in v0.0.1
func (r *IndexClient) Mapping() *bleve.IndexMapping
func (*IndexClient) NewBatch ¶ added in v0.0.1
func (r *IndexClient) NewBatch() *bleve.Batch
func (*IndexClient) Search ¶ added in v0.0.1
func (r *IndexClient) Search(req *bleve.SearchRequest) ( *bleve.SearchResult, error)
func (*IndexClient) SetInternal ¶ added in v0.0.1
func (r *IndexClient) SetInternal(key, val []byte) error
func (*IndexClient) Stats ¶ added in v0.0.1
func (r *IndexClient) Stats() *bleve.IndexStat
type JSONStatsWriter ¶ added in v0.0.1
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)